Use one of the new statuses in the test.
Fix bug in validation test
This commit is contained in:
parent
ac82187bac
commit
49ba36c95e
|
@ -12,6 +12,8 @@
|
|||
<camunda:value id="hold" name="Hold" />
|
||||
<camunda:value id="open_for_enrollment" name="Open For Enrollment" />
|
||||
<camunda:value id="abandoned" name="Abandoned" />
|
||||
<camunda:value id="approved" name="Approved" />
|
||||
<camunda:value id="disapproved" name="Disapproved" />
|
||||
<camunda:value id="asdf" name="asdf" />
|
||||
</camunda:formField>
|
||||
</camunda:formData>
|
||||
|
|
|
@ -7,7 +7,15 @@ class TestSetStudyStatus(BaseTest):
|
|||
self.load_example_data()
|
||||
spec_model = self.load_test_spec('set_study_status')
|
||||
rv = self.app.get('/v1.0/workflow-specification/%s/validate' % spec_model.id, headers=self.logged_in_headers())
|
||||
self.assertEqual([], rv.json)
|
||||
# The workflow has an enum option that causes an exception.
|
||||
# We take advantage of this in test_set_study_status_fail below.
|
||||
# Sometimes, the validation process chooses the failing path,
|
||||
# so we have to check for that here.
|
||||
try:
|
||||
self.assertEqual([], rv.json)
|
||||
except AssertionError:
|
||||
# 'asdf' is the failing enum option
|
||||
self.assertEqual('asdf', rv.json[0]['task_data']['selected_status'])
|
||||
|
||||
def test_set_study_status(self):
|
||||
workflow = self.create_workflow('set_study_status')
|
||||
|
@ -17,12 +25,12 @@ class TestSetStudyStatus(BaseTest):
|
|||
original_status = task.data['original_status']
|
||||
self.assertEqual('in_progress', original_status)
|
||||
|
||||
workflow_api = self.complete_form(workflow, task, {'selected_status': 'hold'})
|
||||
workflow_api = self.complete_form(workflow, task, {'selected_status': 'disapproved'})
|
||||
task = workflow_api.next_task
|
||||
|
||||
self.assertEqual('Activity_DisplayStatus', task.name)
|
||||
self.assertEqual('hold', task.data['selected_status'])
|
||||
self.assertEqual('hold', task.data['new_status'])
|
||||
self.assertEqual('disapproved', task.data['selected_status'])
|
||||
self.assertEqual('disapproved', task.data['new_status'])
|
||||
|
||||
def test_set_study_status_fail(self):
|
||||
|
||||
|
|
Loading…
Reference in New Issue