                           False)
  
      def test_label(self):
          for field in (self.required_field, self.optional_field):
              self.assertEqual(humanize_field(field)['label'], field.label)
  
  
  class Form(forms.Form):
      field1 = forms.CharField(max_length=3, label='field one')
      field2 = forms.CharField(label='field two')
 
</s> remove class Form(forms.Form):
    field1 = forms.CharField(max_length=3, label='field one')
    field2 = forms.CharField(label='field two')
 </s> add class HumanizableSerializer(Serializer):
    field1 = CharField(3, required=True)
    field2 = CharField(10, required=False) </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(humanize_field(self.required_field)['required'], True)
 </s> add         self.assertEqual(self.required_field.humanized['required'], True) </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)
            self.assertEqual(field.humanized['label'], field.label)
                           False)
  
      def test_label(self):
          for field in (self.required_field, self.optional_field):
            self.assertEqual(field.humanized['label'], field.label)
  
  
  class Form(forms.Form):
      field1 = forms.CharField(max_length=3, label='field one')
      field2 = forms.CharField(label='field two')
keep keep keep keep replace keep keep keep keep keep
 simplified, moved field humanizing to Field. broken tests 
rest_framework/tests/fields.py