api_test.py 文件源码

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

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


问题


面经


文章

微信
公众号

扫码关注公众号