api_test.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:micromasters 作者: mitodl 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号