test_management_update_user.py 文件源码

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

项目:SpongeAuth 作者: lukegb 项目源码 文件源码
def test_users_missing(settings):
    out = io.StringIO()

    user1 = UserFactory.create()
    user2 = UserFactory.create()

    with pytest.raises(CommandError) as exc:
        call_command('sso_ping_discourse', 'bar', user1.username, 'baz', stdout=out)

    assert user1.username not in out.getvalue()
    assert user2.username not in str(exc.value)
    assert user2.username not in out.getvalue()

    assert str(exc.value) in (
        'User mismatch: couldn\'t find "bar", "baz"',
        'User mismatch: couldn\'t find "baz", "bar"',
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号