title: Testing Django Wizard Views
body: <p>I'm writing tests for my wizard using this excellent example from <a href="http://pydoc.net/django-formwizard/1.0/formwizard.tests.wizardtests.tests/" rel="nofollow noreferrer">PyDoc.net</a>.</p>
  
  <p>One of the methods in my TestCase is not returning the correct step in the wizard:</p>
  
  <pre><code>class WizardTests(TestCase):
      wizard_step_data = (
          {
              'step2-address': '123 Anywhere Ln.'
              'wizard_wizard-current_step': 'step2'
          },
      )
  
      def test_form_post_success(self):
          response = self.client.post('/wizard/new/step2', self.wizard_step_data[0])
          wizard = response.context['wizard']
          self.assertEqual(response.status_code, 200)
          self.assertEqual(wizard['steps'].current, 'step2')
  </code></pre>
  
  <p>When I run this, I get back:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/var/www/app/wizard/tests.py", line 71, in test_form_post_success
      self.assertEqual(wizard['steps'].current, 'step2')
  AssertionError: 'step1' != 'step2'
  </code></pre>
  
  <p>I am using a NamedUrlSessionWizardView, which is why my URL on the <code>self.client.post</code> is <code>/wizard/new/step2</code>, as opposed to just <code>/wizard/</code> like the example above.  Otherwise, I receive 404's, or 301's for <code>/wizard/new</code>. </p>
  
  <p>Do you have any ideas about what could be causing this?</p>