mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 14:24:48 +03:00
Revert error messages.
This commit is contained in:
parent
1f20cb7753
commit
87aff642fb
|
@ -39,7 +39,7 @@ class TestSimpleBoundField:
|
|||
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
|
||||
|
|
|
@ -154,7 +154,7 @@ class TestRootView(TestCase):
|
|||
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'))
|
||||
|
||||
|
||||
|
@ -301,7 +301,7 @@ class TestInstanceView(TestCase):
|
|||
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'))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user