Author: russellm
Date: 2010-03-23 09:11:41 -0500 (Tue, 23 Mar 2010)
New Revision: 12838

Modified:
   django/trunk/tests/modeltests/field_subclassing/fields.py
   django/trunk/tests/modeltests/field_subclassing/models.py
Log:
Fixed #13171 -- Corrected the field_subclassing unit test. Thanks to Gabriel 
Hurley for the report and patch.

Modified: django/trunk/tests/modeltests/field_subclassing/fields.py
===================================================================
--- django/trunk/tests/modeltests/field_subclassing/fields.py   2010-03-23 
14:08:31 UTC (rev 12837)
+++ django/trunk/tests/modeltests/field_subclassing/fields.py   2010-03-23 
14:11:41 UTC (rev 12838)
@@ -41,14 +41,14 @@
     def get_db_prep_save(self, value):
         return unicode(value)
 
-    def get_db_prep_lookup(self, lookup_type, value):
+    def get_prep_lookup(self, lookup_type, value):
         if lookup_type == 'exact':
             return force_unicode(value)
         if lookup_type == 'in':
             return [force_unicode(v) for v in value]
         if lookup_type == 'isnull':
             return []
-        raise FieldError('Invalid lookup type: %r' % lookup_type)
+        raise TypeError('Invalid lookup type: %r' % lookup_type)
 
 
 class JSONField(models.TextField):

Modified: django/trunk/tests/modeltests/field_subclassing/models.py
===================================================================
--- django/trunk/tests/modeltests/field_subclassing/models.py   2010-03-23 
14:08:31 UTC (rev 12837)
+++ django/trunk/tests/modeltests/field_subclassing/models.py   2010-03-23 
14:11:41 UTC (rev 12838)
@@ -51,7 +51,7 @@
 >>> MyModel.objects.filter(data__lt=s)
 Traceback (most recent call last):
 ...
-FieldError: Invalid lookup type: 'lt'
+TypeError: Invalid lookup type: 'lt'
 
 # Serialization works, too.
 >>> stream = serializers.serialize("json", MyModel.objects.all())

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to