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
39ac1d9c
Commit
39ac1d9c
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
unit test checking if results are vali when no info about visible columns is available
parent
be701969
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!101
Resolve "list of subjects should contain columns dependent on the study"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/tests/api_views/test_subject.py
+11
-1
11 additions, 1 deletion
smash/web/tests/api_views/test_subject.py
with
11 additions
and
1 deletion
smash/web/tests/api_views/test_subject.py
+
11
−
1
View file @
39ac1d9c
...
@@ -11,7 +11,8 @@ from django.urls import reverse
...
@@ -11,7 +11,8 @@ from django.urls import reverse
from
web.api_views.subject
import
get_subjects_order
,
get_subjects_filtered
,
serialize_subject
from
web.api_views.subject
import
get_subjects_order
,
get_subjects_filtered
,
serialize_subject
from
web.models
import
StudySubject
,
Appointment
,
Study
from
web.models
import
StudySubject
,
Appointment
,
Study
from
web.models.constants
import
GLOBAL_STUDY_ID
from
web.models.constants
import
GLOBAL_STUDY_ID
from
web.models.study_subject_list
import
SUBJECT_LIST_GENERIC
,
SUBJECT_LIST_NO_VISIT
,
SUBJECT_LIST_REQUIRE_CONTACT
from
web.models.study_subject_list
import
SUBJECT_LIST_GENERIC
,
SUBJECT_LIST_NO_VISIT
,
SUBJECT_LIST_REQUIRE_CONTACT
,
\
StudySubjectList
from
web.tests.functions
import
create_study_subject
,
create_worker
,
create_get_suffix
,
create_visit
,
\
from
web.tests.functions
import
create_study_subject
,
create_worker
,
create_get_suffix
,
create_visit
,
\
create_appointment
,
create_empty_study_columns
create_appointment
,
create_empty_study_columns
from
web.views.notifications
import
get_today_midnight_date
from
web.views.notifications
import
get_today_midnight_date
...
@@ -56,6 +57,15 @@ class TestApi(TestCase):
...
@@ -56,6 +57,15 @@ class TestApi(TestCase):
columns
=
json
.
loads
(
response
.
content
)[
'
columns
'
]
columns
=
json
.
loads
(
response
.
content
)[
'
columns
'
]
self
.
assertTrue
(
len
(
columns
)
>=
20
)
self
.
assertTrue
(
len
(
columns
)
>=
20
)
def
test_get_columns_when_no_list_is_available
(
self
):
StudySubjectList
.
objects
.
all
().
delete
()
response
=
self
.
client
.
get
(
reverse
(
'
web.api.subjects.columns
'
,
kwargs
=
{
'
subject_list_type
'
:
SUBJECT_LIST_GENERIC
}))
self
.
assertEqual
(
response
.
status_code
,
200
)
columns
=
json
.
loads
(
response
.
content
)[
'
columns
'
]
self
.
assertTrue
(
len
(
columns
)
>
0
)
def
test_get_columns_when_study_has_no_data_columns
(
self
):
def
test_get_columns_when_study_has_no_data_columns
(
self
):
study
=
Study
.
objects
.
filter
(
id
=
GLOBAL_STUDY_ID
)[
0
]
study
=
Study
.
objects
.
filter
(
id
=
GLOBAL_STUDY_ID
)[
0
]
study
.
columns
=
create_empty_study_columns
()
study
.
columns
=
create_empty_study_columns
()
...
...
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