summaryrefslogtreecommitdiff
path: root/tests/custom_lookups
diff options
context:
space:
mode:
Diffstat (limited to 'tests/custom_lookups')
-rw-r--r--tests/custom_lookups/tests.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/custom_lookups/tests.py b/tests/custom_lookups/tests.py
index 670f90f36c..5c9ee5c5ef 100644
--- a/tests/custom_lookups/tests.py
+++ b/tests/custom_lookups/tests.py
@@ -234,17 +234,14 @@ class LookupTests(TestCase):
__exact=None is transformed to __isnull=True if a custom lookup class
with lookup_name != 'exact' is registered as the `exact` lookup.
"""
- class CustomExactLookup(models.Lookup):
- lookup_name = 'somecustomlookup'
-
field = Author._meta.get_field('birthdate')
OldExactLookup = field.get_lookup('exact')
author = Author.objects.create(name='author', birthdate=None)
try:
- type(field).register_lookup(Exactly, 'exact')
+ field.register_lookup(Exactly, 'exact')
self.assertEqual(Author.objects.get(birthdate__exact=None), author)
finally:
- type(field).register_lookup(OldExactLookup, 'exact')
+ field.register_lookup(OldExactLookup, 'exact')
def test_basic_lookup(self):
a1 = Author.objects.create(name='a1', age=1)