diff options
| author | Kent Hauser <kent@khauser.net> | 2012-10-24 16:02:30 -0400 |
|---|---|---|
| committer | Kent Hauser <kent@khauser.net> | 2012-10-31 09:58:28 -0400 |
| commit | ba81164fb771391b92575b5aaab6e286f56eb831 (patch) | |
| tree | 27456904d9cfb007df6d5650d0bcfe8caa03b8e5 | |
| parent | 7f75460fd6befbef805fee3c91608efb0e9f444d (diff) | |
Add `form` to formwizard context (includes tests)
| -rw-r--r-- | django/contrib/formtools/tests/wizard/wizardtests/tests.py | 4 | ||||
| -rw-r--r-- | django/contrib/formtools/wizard/views.py | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/django/contrib/formtools/tests/wizard/wizardtests/tests.py b/django/contrib/formtools/tests/wizard/wizardtests/tests.py index 586bd59341..6403a5548d 100644 --- a/django/contrib/formtools/tests/wizard/wizardtests/tests.py +++ b/django/contrib/formtools/tests/wizard/wizardtests/tests.py @@ -72,6 +72,10 @@ class WizardTests(object): self.assertEqual(response.context['wizard']['steps'].current, 'form2') self.assertEqual(response.context.get('another_var', None), True) + # ticket #19025: `form` should be included in context + form = response.context_data['wizard']['form'] + self.assertEqual(response.context_data['form'], form) + def test_form_finish(self): response = self.client.get(self.wizard_url) self.assertEqual(response.status_code, 200) diff --git a/django/contrib/formtools/wizard/views.py b/django/contrib/formtools/wizard/views.py index ea41e86852..384366e251 100644 --- a/django/contrib/formtools/wizard/views.py +++ b/django/contrib/formtools/wizard/views.py @@ -528,7 +528,7 @@ class WizardView(TemplateView): context.update({'another_var': True}) return context """ - context = super(WizardView, self).get_context_data(**kwargs) + context = super(WizardView, self).get_context_data(form=form, **kwargs) context.update(self.storage.extra_data) context['wizard'] = { 'form': form, |
