本文整理匯總了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)