Skip to content
Prev Previous commit
Next Next commit
Revert error messages.
  • Loading branch information
xordoquy committed Sep 23, 2015
commit 87aff642fb144642be7434f857eaf396fb40b96e
2 changes: 1 addition & 1 deletion tests/test_bound_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ExampleSerializer(serializers.Serializer):
serializer.is_valid()

assert serializer['text'].value == 'x' * 1000
assert serializer['text'].errors == ['Ensure this value has at most 100 characters (it has 1000).']
assert serializer['text'].errors == ['Ensure this field has no more than 100 characters.']
assert serializer['text'].name == 'text'
assert serializer['amount'].value is 123
assert serializer['amount'].errors is None
Expand Down
4 changes: 2 additions & 2 deletions tests/test_generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_post_error_root_view(self):
data = {'text': 'foobar' * 100}
request = factory.post('/', data, HTTP_ACCEPT='text/html')
response = self.view(request).render()
expected_error = '<span class="help-block">Ensure this value has at most 100 characters (it has 600).</span>'
expected_error = '<span class="help-block">Ensure this field has no more than 100 characters.</span>'
self.assertIn(expected_error, response.rendered_content.decode('utf-8'))


Expand Down Expand Up @@ -301,7 +301,7 @@ def test_put_error_instance_view(self):
data = {'text': 'foobar' * 100}
request = factory.put('/', data, HTTP_ACCEPT='text/html')
response = self.view(request, pk=1).render()
expected_error = '<span class="help-block">Ensure this value has at most 100 characters (it has 600).</span>'
expected_error = '<span class="help-block">Ensure this field has no more than 100 characters.</span>'
self.assertIn(expected_error, response.rendered_content.decode('utf-8'))


Expand Down