Esempio n. 1
0
def test_user_schema_missing_userId():
    body = TEST_HUMAN_USER_JSON.copy()
    body.pop("userId")
    with pytest.raises(ValidationError):
        _UserSchema().load(body)
Esempio n. 2
0
def test_user_schema_invalid_uuid():
    body = TEST_HUMAN_USER_JSON.copy()
    body["userId"] = "not-a-uuid"
    with pytest.raises(ValidationError):
        _UserSchema().load(body)
Esempio n. 3
0
def test_user_schema(body, expected_user):
    data = _UserSchema().load(body)
    assert data == expected_user
Esempio n. 4
0
def test_user_schema_invalid():
    with pytest.raises(ValidationError):
        _UserSchema().load({})
Esempio n. 5
0
def test_user_schema_invalid_global_role():
    body = TEST_HUMAN_USER_JSON.copy()
    body["globalRoles"] = ["invalid-global-role"]
    with pytest.raises(ValidationError):
        _UserSchema().load(body)