Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add `form` to formwizard context (includes tests)

  • Loading branch information...
commit ba81164fb771391b92575b5aaab6e286f56eb831 1 parent 7f75460
@kenthauser kenthauser authored
View
4 django/contrib/formtools/tests/wizard/wizardtests/tests.py
@@ -72,6 +72,10 @@ def test_template_context(self):
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)
View
2  django/contrib/formtools/wizard/views.py
@@ -528,7 +528,7 @@ def get_context_data(self, form, **kwargs):
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,
Please sign in to comment.
Something went wrong with that request. Please try again.