1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Refs #34013 -- Registered instance lookups as documented in tests.

This commit is contained in:
Simon Charette 2023-12-16 14:05:36 -05:00 committed by GitHub
parent c83c639ba0
commit eea4f92f9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1734,7 +1734,7 @@ class AggregateTestCase(TestCase):
super().__init__(expr, 100) super().__init__(expr, 100)
sum_field = IntegerField() sum_field = IntegerField()
sum_field.register_instance_lookup(Mod100, "mod100") sum_field.register_lookup(Mod100, "mod100")
publisher_pages = ( publisher_pages = (
Book.objects.values("publisher") Book.objects.values("publisher")
.annotate(sum_pages=Sum("pages", output_field=sum_field)) .annotate(sum_pages=Sum("pages", output_field=sum_field))

View File

@ -337,7 +337,7 @@ class QuerySetSetOperationTests(TestCase):
super().__init__(expr, 2) super().__init__(expr, 2)
output_field = IntegerField() output_field = IntegerField()
output_field.register_instance_lookup(Mod2, "mod2") output_field.register_lookup(Mod2, "mod2")
qs1 = Number.objects.annotate( qs1 = Number.objects.annotate(
annotation=Value(1, output_field=output_field), annotation=Value(1, output_field=output_field),
) )