本文整理汇总了Python中payments.forms.UserForm.clean方法的典型用法代码示例。如果您正苦于以下问题:Python UserForm.clean方法的具体用法?Python UserForm.clean怎么用?Python UserForm.clean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类payments.forms.UserForm
的用法示例。
在下文中一共展示了UserForm.clean方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_user_form_passwords_match
# 需要导入模块: from payments.forms import UserForm [as 别名]
# 或者: from payments.forms.UserForm import clean [as 别名]
def test_user_form_passwords_match(self):
form = UserForm({'name' : 'jj', 'email': '[email protected]', 'password' : '1234',
'ver_password' : '1234', 'last_4_digits' : '3333',
'stripe_token': '1'})
self.assertTrue(form.is_valid())
#this will throw an error if it doesn't clean correctly
self.assertIsNotNone(form.clean())
示例2: test_user_form_passwords_match
# 需要导入模块: from payments.forms import UserForm [as 别名]
# 或者: from payments.forms.UserForm import clean [as 别名]
def test_user_form_passwords_match(self):
form=UserForm(
{
'name':'jj', 'email':'[email protected]',
'password':'1234', 'ver_password':'1234',
'last_4_digits':'3333', 'stripe_token':'1' }
)
# Is the data valid? -- if not print out the errors
self.assertTrue(form.is_valid(),form.errors)
#this will throw an error if the form doesn't clean correctly
self.assertIsNotNone(form.clean())
示例3: test_user_form_passwords_match
# 需要导入模块: from payments.forms import UserForm [as 别名]
# 或者: from payments.forms.UserForm import clean [as 别名]
def test_user_form_passwords_match(self):
form = UserForm(
{
'name': 'jj',
'email': '[email protected]',
'password': '1234',
'ver_password': '1234',
'last_4_digits': '3333',
'stripe_token': '1'
})
self.assertTrue(form.is_valid(), form.errors)
self.assertIsNotNone(form.clean())
示例4: test_user_form_passwords_match
# 需要导入模块: from payments.forms import UserForm [as 别名]
# 或者: from payments.forms.UserForm import clean [as 别名]
def test_user_form_passwords_match(self):
form = UserForm(
{
"name": "jj",
"email": "[email protected]",
"password": "1234",
"ver_password": "1234",
"last_4_digits": "3333",
"stripe_token": "1",
"sub_type": "yearly",
}
)
self.assertTrue(form.is_valid())
# this will throw an error if it doesn't clean correctly
self.assertIsNotNone(form.clean())
示例5: test_user_form_passwords_match
# 需要导入模块: from payments.forms import UserForm [as 别名]
# 或者: from payments.forms.UserForm import clean [as 别名]
def test_user_form_passwords_match(self):
form = UserForm(
{
'name': 'Carlos',
'email':'[email protected]',
'password':'1234',
'ver_password':'1234',
'last_4_digits':'2323',
'stripe_token':'1'
}
)
# is the data valid?
self.assertTrue(form.is_valid())
# this will throw an error if the form doesn't clean correctly
self.assertIsNotNone(form.clean())
示例6: test_user_form_passwords_match
# 需要导入模块: from payments.forms import UserForm [as 别名]
# 或者: from payments.forms.UserForm import clean [as 别名]
def test_user_form_passwords_match(self):
form = UserForm(
{
'name': 'jj',
'email': '[email protected]',
'password': '1234',
'ver_password': '1234',
'last_4_digits': '3333',
'stripe_token': '1'
}
)
# Check if data is valid, otherwise print errors
self.assertTrue(form.is_valid(), form.errors)
# throw error if data is not cleaned correctly
self.assertIsNotNone(form.clean())