Skip to content
Snippets Groups Projects
Commit e6c83415 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

test if create dummy script is executed without issues

parent 80eb6396
No related branches found
No related tags found
1 merge request!287Resolve "clean initial database"
Pipeline #35203 passed
......@@ -64,6 +64,14 @@ test_python_latest:
- coverage run --source web manage.py test -v3
- coverage report -m --omit="*/test*,*/migrations*,*debug_utils*"
test_create_dummy_script:
<<: *test_definition
script:
- cp "local_settings_ci_sqlite.py" "smash/smash/local_settings.py"
- cd smash
- python manage.py makemigrations web && python manage.py migrate
- python db_scripts/create_dummy_data.py
build_debian:
image: debian
stage: build
......
......@@ -435,6 +435,7 @@ class smashProvider(BaseProvider):
virus_iga_1 = choice(["Borderline", "Positive", "Negative"], 1, p=[0.02, 0.03, 0.95])[0]
virus_igg_1 = choice(["Borderline", "Positive", "Negative"], 1, p=[0.02, 0.03, 0.95])[0]
if virus_test_1_result is None:
virus_test_1_collection_date = ''
virus_test_1_updated = fake.date_between(start_date='-30d', end_date='-4d')
elif virus_test_1_result == "Inconclusive":
virus_test_1_updated = fake.date_between(start_date='-30d', end_date='-4d')
......@@ -447,14 +448,13 @@ class smashProvider(BaseProvider):
virus_test_1_collection_date = fake.date_between(start_date='-30d', end_date='-4d')
study_subject, _ = StudySubject.objects.update_or_create(nd_number=nd_number, subject=subject,
virus_test_1_result=virus_test_1_result,
virus_test_1_updated=virus_test_1_updated,
virus_test_1_collection_date=virus_test_1_collection_date,
virus_test_1_iga_status=virus_iga_1,
virus_test_1_igg_status=virus_igg_1,
defaults={'default_location': default_location, 'type': type,
'screening_number': screening_number, 'study': study})
study_subject.set_custom_field_value('Visit 0 RT-PCR update date', virus_test_1_updated)
study_subject.set_custom_field_value('Virus 0 RT-PCR', virus_test_1_result)
study_subject.set_custom_field_value('Visit 0 RT-PCR collection date', virus_test_1_collection_date)
study_subject.set_custom_field_value('Visit 0 IgA Status', virus_iga_1)
study_subject.set_custom_field_value('Visit 0 IgG Status', virus_igg_1)
self.alreadyCreatedStudySubjects.append(study_subject)
return study_subject
......@@ -608,7 +608,7 @@ class smashProvider(BaseProvider):
defaults = {'first_name': first_name, 'last_name': last_name,
'email': email, 'unit': unit, 'specialization': specialization,
'phone_number': phone_number, 'user': user}
worker, _ = Worker.objects.update_or_create(first_name=first_name,
last_name=last_name, defaults=defaults)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment