Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Commits
e6c83415
Commit
e6c83415
authored
4 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
test if create dummy script is executed without issues
parent
80eb6396
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!287
Resolve "clean initial database"
Pipeline
#35203
passed
4 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+8
-0
8 additions, 0 deletions
.gitlab-ci.yml
smash/db_scripts/create_dummy_data.py
+7
-7
7 additions, 7 deletions
smash/db_scripts/create_dummy_data.py
with
15 additions
and
7 deletions
.gitlab-ci.yml
+
8
−
0
View file @
e6c83415
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
smash/db_scripts/create_dummy_data.py
+
7
−
7
View file @
e6c83415
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment