145 class WizardPageTwoForm(forms.Form): |
145 class WizardPageTwoForm(forms.Form): |
146 field = forms.CharField() |
146 field = forms.CharField() |
147 |
147 |
148 class WizardClass(wizard.FormWizard): |
148 class WizardClass(wizard.FormWizard): |
149 def render_template(self, *args, **kw): |
149 def render_template(self, *args, **kw): |
150 return "" |
150 return http.HttpResponse("") |
151 |
151 |
152 def done(self, request, cleaned_data): |
152 def done(self, request, cleaned_data): |
153 return http.HttpResponse(success_string) |
153 return http.HttpResponse(success_string) |
154 |
154 |
155 class DummyRequest(object): |
155 class DummyRequest(http.HttpRequest): |
156 def __init__(self, POST=None): |
156 def __init__(self, POST=None): |
|
157 super(DummyRequest, self).__init__() |
157 self.method = POST and "POST" or "GET" |
158 self.method = POST and "POST" or "GET" |
158 self.POST = POST |
159 if POST is not None: |
|
160 self.POST.update(POST) |
|
161 self._dont_enforce_csrf_checks = True |
159 |
162 |
160 class WizardTests(TestCase): |
163 class WizardTests(TestCase): |
161 def test_step_starts_at_zero(self): |
164 def test_step_starts_at_zero(self): |
162 """ |
165 """ |
163 step should be zero for the first form |
166 step should be zero for the first form |