如何查看WTForms验证错误? [英] how to view WTForms validation errors?
本文介绍了如何查看WTForms验证错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写一些基本测试,但测试失败.
I am writing some basic tests and have a test failing.
def test_new_user_registration(self):
self.client.get('/user/register')
form = RegistrationForm(
email=u'crow@crow.com',
first_name=u'Alex',
last_name=u'Frazer',
username=u'crow',
password=u'fake_password',
confirm_password=u'fake_password'
)
self.assertTrue(form.validate())
在form.validate()
上的断言错误失败了,但是我如何查看验证错误是什么?
The assertion error is failing on form.validate()
, but how can I view what the validation errors are?
推荐答案
查看全文