Tests were failing because forms were not sending Q_COMPLETE data.

Added mocked Q_COMPLETE data to `add_study` and `test_add_and_edit_study`.
This commit is contained in:
mike cullerton 2021-04-06 12:23:13 -04:00
parent 15dc53f957
commit 4e2b79741f

View File

@ -57,6 +57,8 @@ class Sanity_Check_Test(unittest.TestCase):
for r in form.requirements:
form.data['requirements'].append(r.data)
form.Q_COMPLETE.data = "('No Error', 'Passed validation.')"
r = self.app.post('/new_study', data=form.data, follow_redirects=False)
assert r.status_code == 302
added_study = Study.query.filter(Study.TITLE == study_title).first()
@ -79,6 +81,7 @@ class Sanity_Check_Test(unittest.TestCase):
for r in form_2.requirements:
form_2.data['requirements'].append(r.data)
form_2.Q_COMPLETE.data = "('No Error', 'Passed validation.')"
r_2 = self.app.post('/study/%i' % added_study.STUDYID, data=form_2.data, follow_redirects=False)
assert r_2.status_code == 302