summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 7443c271e..f6cd3eff4 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -361,7 +361,7 @@ class WizardTest(object):
@classmethod
def wizard_post(cls, client, url, current_step, form_data=None,
- follow=True):
+ follow=True, extra_data=None):
if not url:
url = reverse(cls.url_name)
data = {
@@ -380,6 +380,8 @@ class WizardTest(object):
else:
for k in form_data:
data['{}-{}'.format(current_step, k)] = form_data[k]
+ if extra_data:
+ data.update(extra_data)
try:
response = client.post(url, data, follow=follow)
@@ -400,10 +402,22 @@ class WizardTest(object):
test_form_data.inits(self)
form_data = test_form_data.form_datas
ignored = test_form_data.ignored
+ previous_step, back_tested = None, False
for idx, step in enumerate(self.steps):
current_step, current_form = step
if current_step in ignored:
continue
+ if not previous_step:
+ previous_step = idx
+ elif not back_tested:
+ # test going back on a form
+ response = self.wizard_post(
+ self.client, url, current_step, None,
+ extra_data={"form_previous_step": previous_step}
+ )
+ self.assertEqual(response.status_code, 200)
+ back_tested = True
+
next_form_is_checked = len(self.steps) > idx + 1 and \
self.steps[idx + 1][0] not in ignored
data = []