当前位置: 首页>>代码示例>>Python>>正文


Python UserForm.clean方法代码示例

本文整理汇总了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())
开发者ID:ANB2,项目名称:book3-exercises,代码行数:10,代码来源:testUserModel.py

示例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())
开发者ID:ujrc,项目名称:Realpython_book3,代码行数:13,代码来源:testForms.py

示例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())
开发者ID:fyasko,项目名称:pythontest,代码行数:14,代码来源:tests.py

示例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())
开发者ID:joelstanner,项目名称:realpython---django-mvp,代码行数:18,代码来源:testUserModel.py

示例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())
开发者ID:betolarios,项目名称:django_ecommerce,代码行数:20,代码来源:tests.py

示例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())
开发者ID:hnejadi,项目名称:django-ecommerce-8,代码行数:20,代码来源:tests.py


注:本文中的payments.forms.UserForm.clean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。