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

tests use new SubjectType structure

parent cf98ab46
No related branches found
No related tags found
1 merge request!305Resolve "Allow for adding modifying types of subjects"
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,
......
......@@ -7,7 +7,7 @@ from web.tests.functions import create_subject
logger = logging.getLogger(__name__)
class StudySubjectAddFormTests(LoggedInWithWorkerTestCase):
class SubjectFormsTests(LoggedInWithWorkerTestCase):
def setUp(self):
super().setUp()
self.subject = create_subject()
......
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