diff options
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r-- | ishtar_common/tests.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index a91a0ba58..174918dd4 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -222,9 +222,11 @@ class WizardTest(object): self.wizard_name): [current_step], } + + # reconstruct a POST request if current_step in form_data: d = form_data[current_step] - if type(d) in (list, tuple): # formset + if type(d) in (list, tuple): # is a formset for d_idx, item in enumerate(d): for k in item: data['{}-{}-{}'.format( @@ -239,16 +241,21 @@ class WizardTest(object): response = self.client.post(url, data, follow=not next_form_is_checked) except ValidationError as e: - # on ManagementForm data is missing or has been tampered - # error verify the wizard_name or step name - raise ValidationError(u"Errors: {} on {}.".format( - u" - ".join(e.messages), current_step)) + msg = u"Errors: {} on {}. On \"ManagementForm data is " \ + u"missing or...\" error verify the wizard_name or " \ + u"step name".format(u" - ".join(e.messages), + current_step) + raise ValidationError(msg) self.check_response(response, current_step) if next_form_is_checked: next_form = self.steps[idx + 1][0] self.assertRedirects( response, - '/{}/{}'.format(self.url_name, next_form)) + '/{}/{}'.format(self.url_name, next_form), + msg_prefix="Redirection to {} has failed - " + "Error on previous form ({})?".format( + next_form, current_step) + ) if idx == len(self.steps) - 1: # last form self.assertRedirects( |