MCPcopy
hub / github.com/django/django / test_null_ordering_added

Method test_null_ordering_added

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

Source from the content-addressed store, hash-verified

3160 # NULL" portion in MySQL to prevent unnecessary sorting.
3161 @skipUnlessDBFeature("requires_explicit_null_ordering_when_grouping")
3162 def test_null_ordering_added(self):
3163 query = Tag.objects.values_list("parent_id", flat=True).order_by().query
3164 query.group_by = ["parent_id"]
3165 sql = query.get_compiler(DEFAULT_DB_ALIAS).as_sql()[0]
3166 fragment = "ORDER BY "
3167 pos = sql.find(fragment)
3168 self.assertEqual(sql.find(fragment, pos + 1), -1)
3169 self.assertEqual(sql.find("NULL", pos + len(fragment)), pos + len(fragment))
3170
3171 def test_in_list_limit(self):
3172 # The "in" lookup works with lists of 1000 items or more.

Callers

nothing calls this directly

Calls 5

order_byMethod · 0.80
values_listMethod · 0.80
get_compilerMethod · 0.80
as_sqlMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected