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


Python UserFactory.is_active方法代码示例

本文整理汇总了Python中student.tests.factories.UserFactory.is_active方法的典型用法代码示例。如果您正苦于以下问题:Python UserFactory.is_active方法的具体用法?Python UserFactory.is_active怎么用?Python UserFactory.is_active使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在student.tests.factories.UserFactory的用法示例。


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

示例1: test_provider_login_can_handle_unicode_email_inactive_account

# 需要导入模块: from student.tests.factories import UserFactory [as 别名]
# 或者: from student.tests.factories.UserFactory import is_active [as 别名]
    def test_provider_login_can_handle_unicode_email_inactive_account(self):
        user = UserFactory(email=u"user.ąęł@gmail.com", username=u"ąęół")
        url = reverse("openid-provider-login")

        # login to the client so that we can persist session information
        user.profile.name = u"Jan ĄĘ"
        user.profile.save()
        self.client.login(username=user.username, password="test")
        # login once to get the right session information
        self.attempt_login(200)
        # We trigger situation where user is not active at final phase of
        # OpenId login.
        user.is_active = False
        user.save()
        post_args = {"email": user.email, "password": "test"}
        # call url again, this time with username and password
        self.client.post(url, post_args)
开发者ID:jbzdak,项目名称:edx-platform,代码行数:19,代码来源:test_openid_provider.py

示例2: test_provider_login_can_handle_unicode_email_inactive_account

# 需要导入模块: from student.tests.factories import UserFactory [as 别名]
# 或者: from student.tests.factories.UserFactory import is_active [as 别名]
    def test_provider_login_can_handle_unicode_email_inactive_account(self):
        user = UserFactory(email=u"user.ąęł@gmail.com")
        url = reverse('openid-provider-login')

        # login to the client so that we can persist session information
        user.profile.name = u'Jan ĄĘ'
        user.profile.save()  # pylint: disable=no-member
        self.client.login(username=user.username, password='test')
        # login once to get the right session information
        self.attempt_login(200)
        # We trigger situation where user is not active at final phase of
        # OpenId login.
        user.is_active = False
        user.save()  # pylint: disable=no-member
        post_args = {
            'email': user.email,
            'password': 'test'
        }
        # call url again, this time with username and password
        self.client.post(url, post_args)
开发者ID:caesar2164,项目名称:edx-platform,代码行数:22,代码来源:test_openid_provider.py


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