本文整理汇总了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)
示例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)