MCPcopy
hub / github.com/django/django / test_extra_ordering_quoting

Method test_extra_ordering_quoting

tests/ordering/tests.py:360–376  ·  view source on GitHub ↗

If the extra clause uses an SQL keyword for a name, it will be protected by quoting.

(self)

Source from the content-addressed store, hash-verified

358 )
359
360 def test_extra_ordering_quoting(self):
361 """
362 If the extra clause uses an SQL keyword for a name, it will be
363 protected by quoting.
364 """
365 self.assertQuerySetEqual(
366 Article.objects.extra(
367 select={"order": "pub_date"}, order_by=["order", "headline"]
368 ),
369 [
370 "Article 1",
371 "Article 2",
372 "Article 3",
373 "Article 4",
374 ],
375 attrgetter("headline"),
376 )
377
378 def test_extra_ordering_with_table_name(self):
379 self.assertQuerySetEqual(

Callers

nothing calls this directly

Calls 2

assertQuerySetEqualMethod · 0.80
extraMethod · 0.45

Tested by

no test coverage detected