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
925bd2b4
Commit
925bd2b4
authored
4 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
tests use new SubjectType structure
parent
cf98ab46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!305
Resolve "Allow for adding modifying types of subjects"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
smash/web/tests/forms/test_StudySubjectAddForm.py
+6
-8
6 additions, 8 deletions
smash/web/tests/forms/test_StudySubjectAddForm.py
smash/web/tests/forms/test_subject_forms.py
+1
-1
1 addition, 1 deletion
smash/web/tests/forms/test_subject_forms.py
with
7 additions
and
9 deletions
smash/web/tests/forms/test_StudySubjectAddForm.py
+
6
−
8
View file @
925bd2b4
import
datetime
import
logging
from
django.core.files.uploadedfile
import
SimpleUploadedFile
from
parameterized
import
parameterized
from
web.forms
import
StudySubjectAddForm
from
web.forms.study_subject_forms
import
get_new_screening_number
,
get_study_subject_field_id
from
web.models.constants
import
SUBJECT_TYPE_CHOICES_CONTROL
,
CUSTOM_FIELD_TYPE_TEXT
,
CUSTOM_FIELD_TYPE_BOOLEAN
,
\
CUSTOM_FIELD_TYPE_INTEGER
,
CUSTOM_FIELD_TYPE_DOUBLE
,
CUSTOM_FIELD_TYPE_DATE
,
CUSTOM_FIELD_TYPE_SELECT_LIST
,
\
CUSTOM_FIELD_TYPE_FILE
from
web.models.constants
import
CUSTOM_FIELD_TYPE_TEXT
,
CUSTOM_FIELD_TYPE_BOOLEAN
,
\
CUSTOM_FIELD_TYPE_INTEGER
,
CUSTOM_FIELD_TYPE_DOUBLE
,
CUSTOM_FIELD_TYPE_DATE
,
CUSTOM_FIELD_TYPE_SELECT_LIST
from
web.models.custom_data
import
CustomStudySubjectField
,
CustomStudySubjectValue
from
web.tests
import
LoggedInWithWorkerTestCase
from
web.tests.functions
import
create_study_subject
,
create_subject
,
get_test_study
,
create_empty_study
from
web.tests.functions
import
create_study_subject
,
create_subject
,
get_test_study
,
create_empty_study
,
\
get_control_subject_type
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -20,11 +18,11 @@ class StudySubjectAddFormTests(LoggedInWithWorkerTestCase):
def
setUp
(
self
):
super
().
setUp
()
location
=
self
.
worker
.
locations
.
all
()
[
0
]
location
=
self
.
worker
.
locations
.
all
()
.
first
()
self
.
subject
=
create_subject
()
self
.
study
=
get_test_study
()
self
.
sample_data
=
{
'
type
'
:
SUBJECT_TYPE_CHOICES_CONTROL
,
'
type
'
:
get_control_subject_type
().
id
,
'
default_location
'
:
location
.
id
,
'
screening_number
'
:
"
123
"
,
'
subject
'
:
self
.
subject
.
id
,
...
...
This diff is collapsed.
Click to expand it.
smash/web/tests/forms/test_subject_forms.py
+
1
−
1
View file @
925bd2b4
...
...
@@ -7,7 +7,7 @@ from web.tests.functions import create_subject
logger
=
logging
.
getLogger
(
__name__
)
class
Study
Subject
Add
FormTests
(
LoggedInWithWorkerTestCase
):
class
SubjectForm
s
Tests
(
LoggedInWithWorkerTestCase
):
def
setUp
(
self
):
super
().
setUp
()
self
.
subject
=
create_subject
()
...
...
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