コード例 #1
0
 def test_internal_value_valid(self, data, expected):
     field = SAMLOrgAttrField()
     res = field.to_internal_value(data)
     assert res == expected
コード例 #2
0
 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)
コード例 #3
0
 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