Exemple #1
0
def test_user_schema_missing_userId():
    body = TEST_HUMAN_USER_JSON.copy()
    body.pop("userId")
    with pytest.raises(ValidationError):
        _UserSchema().load(body)
Exemple #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)
Exemple #3
0
def test_user_schema(body, expected_user):
    data = _UserSchema().load(body)
    assert data == expected_user
Exemple #4
0
def test_user_schema_invalid():
    with pytest.raises(ValidationError):
        _UserSchema().load({})
Exemple #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)