from flask import Flask, render_template, session from utils.blueprints.assistant import assistant_bp import os app = Flask(__name__, template_folder='templates') app.config['SECRET_KEY'] = 'test' app.register_blueprint(assistant_bp) # Mock mongo? The template iterates "patients". # We can just render_template directly with calling the view function, or mock mongo. # Easiest is to manually render the template file in a standalone context. @app.route('/test_render') def test(): session['user_name'] = 'Test Assistant' patients = [{'id': 1, 'name': 'John Doe'}, {'id': 2, 'name': 'Jane Doe'}] try: return render_template('assistant/assistant_data_entry.html', patients=patients) except Exception as e: return f"ERROR: {e}" if __name__ == "__main__": with app.test_request_context('/test_render'): print(test())