def test_internal_value_valid(self, data, expected): field = SAMLOrgAttrField() res = field.to_internal_value(data) assert res == expected
def test_internal_value_invalid(self, data, expected): field = SAMLOrgAttrField() with pytest.raises(type(expected)) as e: field.to_internal_value(data) assert str(e.value) == str(expected)
def test_internal_value_invalid(self, data, expected): field = SAMLOrgAttrField() with pytest.raises(ValidationError) as e: field.to_internal_value(data) assert e.value.detail == expected