Add users first
This commit is contained in:
parent
621c11fe24
commit
ac19c3e3c6
|
@ -147,13 +147,6 @@ class BaseTest(unittest.TestCase):
|
||||||
otherwise it depends on a small setup for running tests."""
|
otherwise it depends on a small setup for running tests."""
|
||||||
from example_data import ExampleDataLoader
|
from example_data import ExampleDataLoader
|
||||||
ExampleDataLoader.clean_db()
|
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 in production mode, only add the first user.
|
||||||
if app.config['PRODUCTION']:
|
if app.config['PRODUCTION']:
|
||||||
session.add(UserModel(**self.users[0]))
|
session.add(UserModel(**self.users[0]))
|
||||||
|
@ -161,6 +154,13 @@ class BaseTest(unittest.TestCase):
|
||||||
for user_json in self.users:
|
for user_json in self.users:
|
||||||
session.add(UserModel(**user_json))
|
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()
|
session.commit()
|
||||||
for study_json in self.studies:
|
for study_json in self.studies:
|
||||||
study_model = StudyModel(**study_json)
|
study_model = StudyModel(**study_json)
|
||||||
|
|
Loading…
Reference in New Issue