diff --git a/django/contrib/formtools/tests/__init__.py b/django/contrib/formtools/tests/__init__.py
index 1594133..6f7b6fe 100644
a
|
b
|
class DummyRequest(http.HttpRequest):
|
218 | 218 | ) |
219 | 219 | class WizardTests(TestCase): |
220 | 220 | urls = 'django.contrib.formtools.tests.urls' |
221 | | input_re = re.compile('name="([^"]+)" value="([^"]+)"') |
| 221 | name_re = re.compile('name="([^"]+)"') |
| 222 | value_re = re.compile('value="([^"]+)"') |
222 | 223 | wizard_step_data = ( |
223 | 224 | { |
224 | 225 | '0-name': 'Pony', |
… |
… |
class WizardTests(TestCase):
|
410 | 411 | Pull the appropriate field data from the context to pass to the next wizard step |
411 | 412 | """ |
412 | 413 | previous_fields = response.context['previous_fields'] |
413 | | fields = {'wizard_step': response.context['step0']} |
414 | | |
415 | | def grab(m): |
416 | | fields[m.group(1)] = m.group(2) |
417 | | return '' |
418 | | |
419 | | self.input_re.sub(grab, previous_fields) |
| 414 | fields = dict(zip( |
| 415 | self.name_re.findall(previous_fields), |
| 416 | self.value_re.findall(previous_fields))) |
| 417 | fields['wizard_step'] = response.context['step0'] |
420 | 418 | return fields |
421 | 419 | |
422 | 420 | def check_wizard_step(self, response, step_no): |
diff --git a/django/contrib/formtools/tests/wizard/cookiestorage.py b/django/contrib/formtools/tests/wizard/cookiestorage.py
index 495d3af..f0be2b8 100644
a
|
b
|
from django.test import TestCase
|
2 | 2 | from django.core import signing |
3 | 3 | from django.core.exceptions import SuspiciousOperation |
4 | 4 | from django.http import HttpResponse |
| 5 | from django.utils import simplejson as json |
5 | 6 | |
6 | 7 | from django.contrib.formtools.wizard.storage.cookie import CookieStorage |
7 | 8 | from django.contrib.formtools.tests.wizard.storage import get_request, TestStorage |
… |
… |
class TestCookieStorage(TestStorage, TestCase):
|
41 | 42 | storage.init_data() |
42 | 43 | storage.update_response(response) |
43 | 44 | unsigned_cookie_data = cookie_signer.unsign(response.cookies[storage.prefix].value) |
44 | | self.assertEqual(unsigned_cookie_data, '{"step_files":{},"step":null,"extra_data":{},"step_data":{}}') |
| 45 | self.assertEqual(json.loads(unsigned_cookie_data), {"step_files":{},"step":None,"extra_data":{},"step_data":{}}) |