summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-06-30 16:38:15 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-06-30 16:38:15 +0200
commit98dfb2e3b06d04248a39b18019a46c2bb63efb8c (patch)
tree7406d366ef6baa7b421f98f9bb1aed3bc1b17a29 /ishtar_common/tests.py
parent3a4a2cf0ef72f044f0ca1c42fb2714b362252753 (diff)
downloadIshtar-98dfb2e3b06d04248a39b18019a46c2bb63efb8c.tar.bz2
Ishtar-98dfb2e3b06d04248a39b18019a46c2bb63efb8c.zip
Sources wizard: fix author deletion (refs #3634)
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(