Ticket #13171: field_subclassing_tests_patch.diff

File field_subclassing_tests_patch.diff, 1.3 KB (added by Gabriel Hurley, 15 years ago)

Patches broken test for field_subclassing

  • tests/modeltests/field_subclassing/fields.py

     
    4141    def get_db_prep_save(self, value):
    4242        return unicode(value)
    4343
    44     def get_db_prep_lookup(self, lookup_type, value):
     44    def get_prep_lookup(self, lookup_type, value):
    4545        if lookup_type == 'exact':
    4646            return force_unicode(value)
    4747        if lookup_type == 'in':
    4848            return [force_unicode(v) for v in value]
    4949        if lookup_type == 'isnull':
    5050            return []
    51         raise FieldError('Invalid lookup type: %r' % lookup_type)
     51        raise TypeError('Invalid lookup type: %r' % lookup_type)
    5252
    5353
    5454class JSONField(models.TextField):
  • tests/modeltests/field_subclassing/models.py

     
    5151>>> MyModel.objects.filter(data__lt=s)
    5252Traceback (most recent call last):
    5353...
    54 FieldError: Invalid lookup type: 'lt'
     54TypeError: Invalid lookup type: 'lt'
    5555
    5656# Serialization works, too.
    5757>>> stream = serializers.serialize("json", MyModel.objects.all())
Back to Top