summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-06-30 17:01:23 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-06-30 17:01:23 +0200
commit9a2190528b3afaeefcf7f69b338ab852d9ad845c (patch)
tree0258275ee931d1b2aaa1e959168e241b2faa7837 /ishtar_common/tests.py
parent47c81f3026c88230894a30d4cd0ab1de0043cc56 (diff)
parentf64baa1026aaf79e62cd604ac94dc21382f07e5a (diff)
downloadIshtar-9a2190528b3afaeefcf7f69b338ab852d9ad845c.tar.bz2
Ishtar-9a2190528b3afaeefcf7f69b338ab852d9ad845c.zip
Merge branch 'v0.9' into wheezy
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py19
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(