mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Refs #34013 -- Registered instance lookups as documented in tests.
This commit is contained in:
parent
c83c639ba0
commit
eea4f92f9a
@ -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))
|
||||||
|
@ -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),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user