aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests/fields.py
diff options
context:
space:
mode:
authorOscar Vilaplana2013-05-19 15:45:33 +0200
committerOscar Vilaplana2013-05-19 15:45:33 +0200
commit7a5cd090aa91a5d1af0d54586f36e2156e1ccc60 (patch)
tree0e24aa9070eeeb578bb076eba02391f4c80a3d9a /rest_framework/tests/fields.py
parent6bbedfd7ae25655d94281764cb375fc7c2d0c13a (diff)
downloaddjango-rest-framework-7a5cd090aa91a5d1af0d54586f36e2156e1ccc60.tar.bz2
fixed tests, added docs, renamed helper method
Diffstat (limited to 'rest_framework/tests/fields.py')
-rw-r--r--rest_framework/tests/fields.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/rest_framework/tests/fields.py b/rest_framework/tests/fields.py
index 13df769f..85698092 100644
--- a/rest_framework/tests/fields.py
+++ b/rest_framework/tests/fields.py
@@ -15,8 +15,8 @@ from django.test import TestCase
from django.utils.datastructures import SortedDict
from rest_framework import serializers
-from rest_framework.fields import (humanize_field, humanize_field_type, humanize_form_fields,
- Field)
+from rest_framework.fields import (humanize_field, humanize_field_type,
+ humanize_form_fields, Field)
from rest_framework.serializers import Serializer
from rest_framework.tests.models import RESTFrameworkModel
@@ -882,10 +882,14 @@ class HumanizedSerializer(TestCase):
def test_humanized(self):
humanized = humanize_form_fields(Form())
- self.assertEqual(humanized, {
- 'field1': {
- u'help_text': u'', u'required': True,
- u'type': u'String', u'label': 'field one'},
- 'field2': {
- u'help_text': u'', u'required': True,
- u'type': u'String', u'label': 'field two'}})
+ expected = {
+ 'field1': {u'help_text': u'',
+ u'label': u'field one',
+ u'max_length': 3,
+ u'required': True,
+ u'type': u'String'},
+ 'field2': {u'help_text': u'',
+ u'label': u'field two',
+ u'required': True,
+ u'type': u'String'}}
+ self.assertEqual(humanized, expected)