diff options
| author | Jannis Leidel <jannis@leidel.info> | 2012-11-17 12:23:48 -0800 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2012-11-17 12:23:48 -0800 |
| commit | 730977046bb25c414a1cf5d665809224cc6b0cea (patch) | |
| tree | 4e778cd7ff236d4fa7877e4992b180a5aba4a57c | |
| parent | 1520748dac95a7f114e4bb2feeee04d46c720494 (diff) | |
| parent | ba81164fb771391b92575b5aaab6e286f56eb831 (diff) | |
Merge pull request #466 from kenthauser/ticket_19025
#19025 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 5b45267f36..cba39151e7 100644 --- a/django/contrib/formtools/wizard/views.py +++ b/django/contrib/formtools/wizard/views.py @@ -530,7 +530,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, |
