def test_two_social(self):
"""
get_social_username should return None if there are two social edX accounts for a user
"""
UserSocialAuthFactory.create(user=self.user, uid='other name')
with LogCapture() as log_capture:
assert get_social_username(self.user) is None
log_capture.check(
(
'profiles.api',
'ERROR',
'Unexpected error retrieving social auth username: get() returned more than '
'one UserSocialAuth -- it returned 2!'
)
)
评论列表
文章目录