• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python forms.RegisterForm类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pybossa.forms.forms.RegisterForm的典型用法代码示例。如果您正苦于以下问题:Python RegisterForm类的具体用法?Python RegisterForm怎么用?Python RegisterForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了RegisterForm类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_register_name_reserved_name

    def test_register_name_reserved_name(self):
        self.fill_in_data['name'] = 'signin'

        form = RegisterForm(**self.fill_in_data)

        assert not form.validate()
        assert u'This name is used by the system.' in form.errors['name'], form.errors
开发者ID:PyBossa,项目名称:pybossa,代码行数:7,代码来源:test_forms.py


示例2: test_register_fullname_length

    def test_register_fullname_length(self):
        self.fill_in_data['fullname'] = 'a'
        form = RegisterForm(**self.fill_in_data)
        error_message = "Full name must be between 3 and %s characters long" % USER_FULLNAME_MAX_LENGTH

        assert not form.validate()
        assert error_message in form.errors['fullname'], form.errors
开发者ID:PyBossa,项目名称:pybossa,代码行数:7,代码来源:test_forms.py


示例3: test_register_email_length

    def test_register_email_length(self):
        self.fill_in_data['email_addr'] = ''
        form = RegisterForm(**self.fill_in_data)
        error_message = "Email must be between 3 and %s characters long" % EMAIL_MAX_LENGTH

        assert not form.validate()
        assert error_message in form.errors['email_addr'], form.errors
开发者ID:PyBossa,项目名称:pybossa,代码行数:7,代码来源:test_forms.py


示例4: test_register_password_valid_password

 def test_register_password_valid_password(self):
     self.fill_in_data['password'] = self.fill_in_data['confirm'] = 'Abcd12345!'
     form = RegisterForm(**self.fill_in_data)
     assert form.validate()
开发者ID:PyBossa,项目名称:pybossa,代码行数:4,代码来源:test_forms.py


示例5: test_register_password_missmatch

    def test_register_password_missmatch(self):
        self.fill_in_data['confirm'] = 'badpasswd'
        form = RegisterForm(**self.fill_in_data)

        assert not form.validate()
        assert "Passwords must match" in form.errors['password'], form.errors
开发者ID:PyBossa,项目名称:pybossa,代码行数:6,代码来源:test_forms.py


示例6: test_register_password_required

    def test_register_password_required(self):
        self.fill_in_data['password'] = ''
        form = RegisterForm(**self.fill_in_data)

        assert not form.validate()
        assert "Password cannot be empty" in form.errors['password'], form.errors
开发者ID:PyBossa,项目名称:pybossa,代码行数:6,代码来源:test_forms.py


示例7: test_register_email_valid_format

    def test_register_email_valid_format(self):
        self.fill_in_data['email_addr'] = 'notanemail'
        form = RegisterForm(**self.fill_in_data)

        assert not form.validate()
        assert "Invalid email address." in form.errors['email_addr'], form.errors
开发者ID:PyBossa,项目名称:pybossa,代码行数:6,代码来源:test_forms.py


示例8: test_register_form_unique_email

    def test_register_form_unique_email(self):
        form = RegisterForm(**self.fill_in_data)
        user = UserFactory.create(email_addr='[email protected]')

        assert not form.validate()
        assert "Email is already taken" in form.errors['email_addr'], form.errors
开发者ID:PyBossa,项目名称:pybossa,代码行数:6,代码来源:test_forms.py


示例9: test_register_name_allowed_chars

    def test_register_name_allowed_chars(self):
        self.fill_in_data['name'] = '$#&\/|'
        form = RegisterForm(**self.fill_in_data)

        assert not form.validate()
        assert "$#&\\/| and space symbols are forbidden" in form.errors['name'], form.errors
开发者ID:PyBossa,项目名称:pybossa,代码行数:6,代码来源:test_forms.py


示例10: test_register_form_unique_name

    def test_register_form_unique_name(self):
        form = RegisterForm(**self.fill_in_data)
        user = UserFactory.create(name='mylion')

        assert not form.validate()
        assert "The user name is already taken" in form.errors['name'], form.errors
开发者ID:PyBossa,项目名称:pybossa,代码行数:6,代码来源:test_forms.py


示例11: test_register_form_validates_with_valid_fields

    def test_register_form_validates_with_valid_fields(self):
        form = RegisterForm(**self.fill_in_data)

        assert form.validate()
开发者ID:PyBossa,项目名称:pybossa,代码行数:4,代码来源:test_forms.py


示例12: test_register_form_contains_fields

    def test_register_form_contains_fields(self):
        form = RegisterForm()

        for field in self.fields:
            assert form.__contains__(field), 'Field %s is not in form' %field
开发者ID:PyBossa,项目名称:pybossa,代码行数:5,代码来源:test_forms.py


示例13: test_register_name_length

    def test_register_name_length(self):
        self.fill_in_data['name'] = 'a'
        form = RegisterForm(**self.fill_in_data)

        assert not form.validate()
        assert "User name must be between 3 and 35 characters long" in form.errors['name'], form.errors
开发者ID:IdahoInstitute,项目名称:pybossa,代码行数:6,代码来源:test_forms.py


示例14: test_register_email_length

    def test_register_email_length(self):
        self.fill_in_data['email_addr'] = ''
        form = RegisterForm(**self.fill_in_data)

        assert not form.validate()
        assert "Email must be between 3 and 35 characters long" in form.errors['email_addr'], form.errors
开发者ID:IdahoInstitute,项目名称:pybossa,代码行数:6,代码来源:test_forms.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python user.User类代码示例发布时间:2022-05-25
下一篇:
Python user_repo.update函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap