Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add `form` to formwizard context (includes tests)

  • Loading branch information...
commit ba81164fb771391b92575b5aaab6e286f56eb831 1 parent 7f75460
kenthauser authored October 24, 2012
4  django/contrib/formtools/tests/wizard/wizardtests/tests.py
@@ -72,6 +72,10 @@ def test_template_context(self):
72 72
         self.assertEqual(response.context['wizard']['steps'].current, 'form2')
73 73
         self.assertEqual(response.context.get('another_var', None), True)
74 74
 
  75
+        # ticket #19025: `form` should be included in context
  76
+        form = response.context_data['wizard']['form']
  77
+        self.assertEqual(response.context_data['form'], form)            
  78
+
75 79
     def test_form_finish(self):
76 80
         response = self.client.get(self.wizard_url)
77 81
         self.assertEqual(response.status_code, 200)
2  django/contrib/formtools/wizard/views.py
@@ -528,7 +528,7 @@ def get_context_data(self, form, **kwargs):
528 528
                         context.update({'another_var': True})
529 529
                     return context
530 530
         """
531  
-        context = super(WizardView, self).get_context_data(**kwargs)
  531
+        context = super(WizardView, self).get_context_data(form=form, **kwargs)
532 532
         context.update(self.storage.extra_data)
533 533
         context['wizard'] = {
534 534
             'form': form,

0 notes on commit ba81164

Please sign in to comment.
Something went wrong with that request. Please try again.