【发布时间】:2012-07-08 14:18:05
【问题描述】:
我正在尝试为表单向导视图 django.contrib.formstools.wizard.views.CookieWizardView 编写测试,但我不确定如何处理在测试用例中编写顺序帖子:
#test_views.py
def test_wizard_pass(self):
response = self.c.post('/wizard/url/',first_form_post_dict)
self.assertContains(...)
response = self.c.post('/wizard/url/',second_step_post_dict)
self.assertRedirect(...)
我假设我需要根据第一个响应中的某些内容或与用于会话管理的 cookie 有关的内容更改第二个帖子数据,我只是不确定是什么。
【问题讨论】:
标签: django django-forms django-views django-testing django-formwizard