diff --git a/tests/base_test.py b/tests/base_test.py index 5876e503..ea0e7c16 100644 --- a/tests/base_test.py +++ b/tests/base_test.py @@ -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)