def test_get_social_auth(self):
"""
Tests that get_social_auth returns a user's edX social auth object, and if multiple edX social auth objects
exists, it raises an exception
"""
assert get_social_auth(self.user) == self.user.social_auth.get(provider=EdxOrgOAuth2.name)
UserSocialAuthFactory.create(user=self.user, uid='other name')
with self.assertRaises(MultipleObjectsReturned):
get_social_auth(self.user)
评论列表
文章目录