Ticket #20116: formwizard_formset_test.diff
File formwizard_formset_test.diff, 2.7 KB (added by , 12 years ago) |
---|
-
django/contrib/formtools/tests/wizard/__init__.py
diff --git a/django/contrib/formtools/tests/wizard/__init__.py b/django/contrib/formtools/tests/wizard/__init__.py index a2a9692..55c6e17 100644
a b from django.contrib.formtools.tests.wizard.sessionstorage import TestSessionStor 13 13 from django.contrib.formtools.tests.wizard.wizardtests.tests import ( 14 14 SessionWizardTests, 15 15 CookieWizardTests, 16 FormsetWizardTests, 16 17 WizardTestKwargs, 17 18 WizardTestGenericViewInterface, 18 19 WizardFormKwargsOverrideTests, -
django/contrib/formtools/tests/wizard/wizardtests/tests.py
diff --git a/django/contrib/formtools/tests/wizard/wizardtests/tests.py b/django/contrib/formtools/tests/wizard/wizardtests/tests.py index 1ee5dbd..c152cbe 100644
a b class WizardFormKwargsOverrideTests(TestCase): 404 404 self.assertEqual(formset.initial_form_count(), 1) 405 405 self.assertEqual(['staff@example.com'], 406 406 list(formset.queryset.values_list('email', flat=True))) 407 408 409 class FormsetWizardTests(TestCase): 410 urls = 'django.contrib.formtools.tests.wizard.wizardtests.urls' 411 wizard_url = '/wiz_formset/' 412 wizard_step_data = ( 413 { 414 'form1-INITIAL_FORMS': '0', 415 'form1-TOTAL_FORMS': '2', 416 'form1-MAX_NUM_FORMS': '0', 417 'form1-0-random_crap': 'blah blah', 418 'form1-1-random_crap': 'blah blah', 419 'cookie_contact_wizard-current_step': 'form1', 420 }, 421 { 422 'form2-random_crap': 'blah blah', 423 'cookie_contact_wizard-current_step': 'form2', 424 }, 425 ) 426 427 def test_resend_data(self): 428 response = self.client.post(self.wizard_url, self.wizard_step_data[0]) 429 self.assertEqual(response.status_code, 200) 430 431 response = self.client.post(self.wizard_url, self.wizard_step_data[1]) 432 self.assertEqual(response.status_code, 200) 433 434 response = self.client.post(self.wizard_url, self.wizard_step_data[1]) 435 self.assertEqual(response.status_code, 200) -
django/contrib/formtools/tests/wizard/wizardtests/urls.py
diff --git a/django/contrib/formtools/tests/wizard/wizardtests/urls.py b/django/contrib/formtools/tests/wizard/wizardtests/urls.py index dabce53..1d9b7d4 100644
a b urlpatterns = patterns('', 19 19 ('form3', Page3), 20 20 ('form4', Page4)], 21 21 template_name='other_wizard_form.html')), 22 url(r'^wiz_formset/$', CookieContactWizard.as_view( 23 [('form1', Page4), # The test needs the formset as first form 24 ('form2', Page3)])), 22 25 )