3 from app.models import db, User
4 from app.default_data import populate
6 def clear_data(session):
8 for table in reversed(meta.sorted_tables):
9 session.execute(f'ALTER TABLE "{table.name}" DISABLE TRIGGER ALL;')
10 session.execute(table.delete())
11 session.execute(f'ALTER TABLE "{table.name}" ENABLE TRIGGER ALL;')
12 #session.execute(table.delete())
15 clear_data(db.session)
22 app.config["TESTING"] = True
25 assert User.query.count() == 1
27 with app.test_client() as client:
30 app.config["TESTING"] = False