本文整理汇总了Python中myjobs.tests.factories.UserFactory.is_verified方法的典型用法代码示例。如果您正苦于以下问题:Python UserFactory.is_verified方法的具体用法?Python UserFactory.is_verified怎么用?Python UserFactory.is_verified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myjobs.tests.factories.UserFactory
的用法示例。
在下文中一共展示了UserFactory.is_verified方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_inactive_user_sees_message
# 需要导入模块: from myjobs.tests.factories import UserFactory [as 别名]
# 或者: from myjobs.tests.factories.UserFactory import is_verified [as 别名]
def test_inactive_user_sees_message(self):
"""
A user with is_verified or is_active set to False should see an
activation message instead of the content they were originally meaning
to see.
"""
client = TestClient(path=reverse('saved_search_main'))
user = UserFactory()
# Active user
client.login_user(user)
resp = client.get()
self.assertIn('Saved Search', resp.content)
# Inactive user
user.is_verified= False
user.save()
resp = client.get()
self.assertIn('unavailable', resp.content)