MCPcopy
hub / github.com/django/django / test_order_by_resetting

Method test_order_by_resetting

tests/queries/tests.py:1673–1678  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1671 self.assertEqual(obj.person.details.data, "d2")
1672
1673 def test_order_by_resetting(self):
1674 # Calling order_by() with no parameters removes any existing ordering
1675 # on the model. But it should still be possible to add new ordering
1676 # after that.
1677 qs = Author.objects.order_by().order_by("name")
1678 self.assertIn("ORDER BY", qs.query.get_compiler(qs.db).as_sql()[0])
1679
1680 def test_order_by_reverse_fk(self):
1681 # It is possible to order by reverse of foreign key, although that can

Callers

nothing calls this directly

Calls 3

order_byMethod · 0.80
get_compilerMethod · 0.80
as_sqlMethod · 0.45

Tested by

no test coverage detected