Spaces:
Runtime error
Runtime error
File size: 863 Bytes
ed0b977 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
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())
|