I am trying to write test cases for a django 1.4 CookieWizardView 
(django.contrib.formtools.wizard.views.CookieWizardView), and I'm not sure 
how to handle sending multiple posts to the view.

class TestWizardView(TestCase):
    def setUp(self):
        self.form_one_post = QueryDict('field_1=value')
        self.form_two_post = QueryDict('field_2=value2')
        self.c = Client()

    def test_form(self):
        response = self.c.post('/wzd/url/',self.form_one_post)
        self.assertContains(...)
        response = self.c.post('/wzd/url/',self.form_two_post)
        self.assertRedirects(...)  # Successful post should redirect to 
Done page.

But when I do this, i get:
ValidationError: 'ManagementForm data is missing or has been tampered.'

This makes sense, since I haven't put any post information for the 
management_form (django.contrib.formtools.wizard.forms.ManagementForm), but 
I don't know where to get that information/where to put that information or 
what that information is supposed to be.

Any help on how to resolve this or better ways to implement a view test for 
a wizard would be appreciated.

James

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/6uuoOz2kev4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to