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

invalid field reference fixed

parent 54a6733a
No related branches found
No related tags found
1 merge request!107Resolve "exceeded visits list & unfinished visits list"
...@@ -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 = []
......
...@@ -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 TestApi(TestCase): class TestSubjectApi(LoggedInWithWorkerTestCase):
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"
......
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