本文整理汇总了Python中social.tests.models.User.email方法的典型用法代码示例。如果您正苦于以下问题:Python User.email方法的具体用法?Python User.email怎么用?Python User.email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类social.tests.models.User
的用法示例。
在下文中一共展示了User.email方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_multiple_accounts_with_same_email
# 需要导入模块: from social.tests.models import User [as 别名]
# 或者: from social.tests.models.User import email [as 别名]
def test_multiple_accounts_with_same_email(self):
user1 = User(username='foobar1')
user2 = User(username='foobar2')
user1.email = '[email protected]'
user2.email = '[email protected]'
self.do_login.when.called_with(after_complete_checks=False)\
.should.throw(AuthException)
示例2: test_multiple_accounts_with_same_email
# 需要导入模块: from social.tests.models import User [as 别名]
# 或者: from social.tests.models.User import email [as 别名]
def test_multiple_accounts_with_same_email(self):
user1 = User(username='foobar1')
user2 = User(username='foobar2')
user1.email = '[email protected]'
user2.email = '[email protected]'
with self.assertRaises(AuthException):
self.do_login(after_complete_checks=False)
示例3: test_user_persists_in_partial_pipeline
# 需要导入模块: from social.tests.models import User [as 别名]
# 或者: from social.tests.models.User import email [as 别名]
def test_user_persists_in_partial_pipeline(self):
user = User(username='foobar1')
user.email = '[email protected]'
self.strategy.set_settings({
'SOCIAL_AUTH_PIPELINE': (
'social.pipeline.social_auth.social_details',
'social.pipeline.social_auth.social_uid',
'social.pipeline.social_auth.associate_by_email',
'social.tests.pipeline.set_user_from_args'
)
})
redirect = self.do_login(after_complete_checks=False)
# Handle the partial pipeline
self.strategy.session_set('attribute', 'testing')
data = self.strategy.session_pop('partial_pipeline')
idx, backend, xargs, xkwargs = self.strategy.partial_from_session(data)
self.backend.continue_pipeline(pipeline_index=idx,
*xargs, **xkwargs)