          self.optional_field = Field()
          self.optional_field.label = uuid4().hex
          self.optional_field.required = False
  
      def test_required(self):
          self.assertEqual(self.required_field.humanized['required'], True)
  
      def test_optional(self):
          self.assertEqual(self.optional_field.humanized['required'], False)
 
</s> remove         self.assertEqual(humanize_field(self.required_field)['required'], True)
 </s> add         self.assertEqual(self.required_field.humanized['required'], True) </s> remove         self.assertEqual(humanize_field(self.optional_field)['required'],
                         False)
 </s> add         self.assertEqual(self.optional_field.humanized['required'], False) </s> remove         self.assertEqual(getattr(serializer.fields['url_field'], 'max_length'), 20)


class HumanizedFieldType(TestCase):
    def test_standard_type_classes(self):
        for field_type_name in forms.fields.__all__:
            field_type = getattr(forms.fields, field_type_name)
            humanized = humanize_field_type(field_type)
            self.assert_valid_name(humanized)

    def test_standard_type_names(self):
        for field_type_name in forms.fields.__all__:
            humanized = humanize_field_type(field_type_name)
            self.assert_valid_name(humanized)

    def test_custom_type_name(self):
        humanized = humanize_field_type('SomeCustomType')
        self.assertEquals(humanized, u'Some custom type')

    def test_custom_type(self):
        custom_type = namedtuple('SomeCustomType', [])
        humanized = humanize_field_type(custom_type)
        self.assertEquals(humanized, u'Some custom type')

    def assert_valid_name(self, humanized):
        """A humanized field name is valid if it's a non-empty
        unicode.

        """
        self.assertIsInstance(humanized, unicode)
        self.assertNotEqual(humanized, '')
 </s> add         self.assertEqual(getattr(serializer.fields['url_field'],
                         'max_length'), 20) </s> remove             self.assertEqual(humanize_field(field)['label'], field.label)
 </s> add             self.assertEqual(field.humanized['label'], field.label) </s> remove         self.assertEqual(getattr(serializer.fields['url_field'], 'max_length'), 128)
 </s> add         self.assertEqual(getattr(serializer.fields['url_field'],
                                 'max_length'), 128)
    def test_type(self):
        for field in (self.required_field, self.optional_field):
            self.assertEqual(field.humanized['type'], field.type_name)

          self.optional_field = Field()
          self.optional_field.label = uuid4().hex
          self.optional_field.required = False
  
    def test_type(self):
        for field in (self.required_field, self.optional_field):
            self.assertEqual(field.humanized['type'], field.type_name)

      def test_required(self):
          self.assertEqual(self.required_field.humanized['required'], True)
  
      def test_optional(self):
          self.assertEqual(self.optional_field.humanized['required'], False)
keep keep keep add keep keep keep keep keep
 simplified, moved field humanizing to Field. broken tests 
rest_framework/tests/fields.py