def test_user_schema_missing_userId(): body = TEST_HUMAN_USER_JSON.copy() body.pop("userId") with pytest.raises(ValidationError): _UserSchema().load(body)
def test_user_schema_invalid_uuid(): body = TEST_HUMAN_USER_JSON.copy() body["userId"] = "not-a-uuid" with pytest.raises(ValidationError): _UserSchema().load(body)
def test_user_schema(body, expected_user): data = _UserSchema().load(body) assert data == expected_user
def test_user_schema_invalid(): with pytest.raises(ValidationError): _UserSchema().load({})
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)