Beispiel #1
0
 def test_null_arg(self):
     """A embedded null character is a validation error."""
     field = MultipleStringField()
     value = "Embeded_Null_\x00"
     with pytest.raises(ValidationError):
         field.clean([value])
Beispiel #2
0
 def test_empty_list_optional(self):
     """If a field is optional, an empty list is valid."""
     assert MultipleStringField(required=False).clean([]) == []
Beispiel #3
0
 def test_good_argument(self):
     """A list with one string arguments is valid."""
     assert MultipleStringField().clean(["one"]) == ["one"]
Beispiel #4
0
 def test_empty_list_required(self):
     """If a field is required, an empty list is a validation error."""
     field = MultipleStringField()
     with pytest.raises(ValidationError):
         field.clean([])