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
bb60eac5
Commit
bb60eac5
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
invalid field reference fixed
parent
54a6733a
No related branches found
No related tags found
1 merge request
!107
Resolve "exceeded visits list & unfinished visits list"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
smash/web/api_views/subject.py
+1
-1
1 addition, 1 deletion
smash/web/api_views/subject.py
smash/web/tests/api_views/test_subject.py
+3
-8
3 additions, 8 deletions
smash/web/tests/api_views/test_subject.py
with
4 additions
and
9 deletions
smash/web/api_views/subject.py
+
1
−
1
View file @
bb60eac5
...
@@ -323,7 +323,7 @@ def types(request):
...
@@ -323,7 +323,7 @@ def types(request):
def
serialize_subject
(
study_subject
):
def
serialize_subject
(
study_subject
):
location
=
location_to_str
(
study_subject
.
location
)
location
=
location_to_str
(
study_subject
.
default_
location
)
flying_team
=
flying_team_to_str
(
study_subject
.
flying_team
)
flying_team
=
flying_team_to_str
(
study_subject
.
flying_team
)
visits
=
Visit
.
objects
.
filter
(
subject
=
study_subject
).
order_by
(
'
visit_number
'
)
visits
=
Visit
.
objects
.
filter
(
subject
=
study_subject
).
order_by
(
'
visit_number
'
)
serialized_visits
=
[]
serialized_visits
=
[]
...
...
This diff is collapsed.
Click to expand it.
smash/web/tests/api_views/test_subject.py
+
3
−
8
View file @
bb60eac5
...
@@ -8,6 +8,7 @@ from django.test import Client
...
@@ -8,6 +8,7 @@ from django.test import Client
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.urls
import
reverse
from
django.urls
import
reverse
from
tests
import
LoggedInWithWorkerTestCase
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
,
SUBJECT_TYPE_CHOICES_PATIENT
,
SUBJECT_TYPE_CHOICES_CONTROL
from
web.models.constants
import
GLOBAL_STUDY_ID
,
SUBJECT_TYPE_CHOICES_PATIENT
,
SUBJECT_TYPE_CHOICES_CONTROL
...
@@ -20,16 +21,10 @@ from web.views.notifications import get_today_midnight_date
...
@@ -20,16 +21,10 @@ from web.views.notifications import get_today_midnight_date
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
class
Test
Api
(
TestCase
):
class
Test
SubjectApi
(
LoggedInWithWorker
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
super
(
TestSubjectApi
,
self
).
setUp
()
self
.
study_subject
=
create_study_subject
()
self
.
study_subject
=
create_study_subject
()
self
.
client
=
Client
()
username
=
'
piotr
'
password
=
'
top_secret
'
self
.
user
=
User
.
objects
.
create_user
(
username
=
username
,
email
=
'
jacob@bla
'
,
password
=
password
)
self
.
worker
=
create_worker
(
self
.
user
)
self
.
client
.
login
(
username
=
username
,
password
=
password
)
def
test_cities
(
self
):
def
test_cities
(
self
):
city_name
=
"
some city
"
city_name
=
"
some city
"
...
...
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