MCPcopy
hub / github.com/django/django / test_get_clears_ordering

Method test_get_clears_ordering

tests/queries/tests.py:443–449  ·  view source on GitHub ↗

get() should clear ordering for optimization purposes.

(self)

Source from the content-addressed store, hash-verified

441 )
442
443 def test_get_clears_ordering(self):
444 """
445 get() should clear ordering for optimization purposes.
446 """
447 with CaptureQueriesContext(connection) as captured_queries:
448 Author.objects.order_by("name").get(pk=self.a1.pk)
449 self.assertNotIn("order by", captured_queries[0]["sql"].lower())
450
451 def test_tickets_4088_4306(self):
452 self.assertSequenceEqual(Report.objects.filter(creator=1001), [self.r1])

Callers

nothing calls this directly

Calls 3

order_byMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected