Assert that even though we only submit REVIEW_TYPE in the form, both REVIEW_TYPE and REVIEWTYPENAME are set in the database.

This commit is contained in:
mike cullerton 2021-07-12 17:11:02 -04:00
parent 3018b174f7
commit c56a7c2344

View File

@ -236,12 +236,13 @@ class Sanity_Check_Test(unittest.TestCase):
self.assertEqual(api_result.IDE, '1234')
self.assertEqual(api_result.IND_1, 'abc')
def test_study_details_validation(self):
def test_study_details(self):
test_study = self.add_study()
data = {'IS_IND': 1, 'IND_1': 1234}
data = {'IS_IND': 1, 'IND_1': '1234', 'REVIEW_TYPE': 3}
self.app.post(f'/study_details/{test_study.STUDYID}', data=data, follow_redirects=False)
detail = StudyDetails.query.filter(StudyDetails.STUDYID == test_study.STUDYID).first()
self.assertEqual(detail.IS_IND, 1)
self.assertEqual(detail.IND_1, '1234')
self.assertEqual(detail.REVIEW_TYPE, 3)
self.assertEqual(detail.REVIEWTYPENAME, 'Expedited')