Add users first

This commit is contained in:
mike cullerton 2021-07-07 10:33:30 -04:00
parent 621c11fe24
commit ac19c3e3c6
1 changed files with 7 additions and 7 deletions

View File

@ -147,13 +147,6 @@ class BaseTest(unittest.TestCase):
otherwise it depends on a small setup for running tests."""
from example_data import ExampleDataLoader
ExampleDataLoader.clean_db()
if use_crc_data:
ExampleDataLoader().load_all()
elif use_rrt_data:
ExampleDataLoader().load_rrt()
else:
ExampleDataLoader().load_test_data()
# If in production mode, only add the first user.
if app.config['PRODUCTION']:
session.add(UserModel(**self.users[0]))
@ -161,6 +154,13 @@ class BaseTest(unittest.TestCase):
for user_json in self.users:
session.add(UserModel(**user_json))
if use_crc_data:
ExampleDataLoader().load_all()
elif use_rrt_data:
ExampleDataLoader().load_rrt()
else:
ExampleDataLoader().load_test_data()
session.commit()
for study_json in self.studies:
study_model = StudyModel(**study_json)