MCPcopy
hub / github.com/django/django / test_nested_queries_sql

Method test_nested_queries_sql

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

Source from the content-addressed store, hash-verified

2136 self.assertFalse(qs)
2137
2138 def test_nested_queries_sql(self):
2139 # Nested queries should not evaluate the inner query as part of
2140 # constructing the SQL (so we should see a nested query here, indicated
2141 # by two "SELECT" calls).
2142 qs = Annotation.objects.filter(notes__in=Note.objects.filter(note="xyzzy"))
2143 self.assertEqual(qs.query.get_compiler(qs.db).as_sql()[0].count("SELECT"), 2)
2144
2145 def test_tickets_8921_9188(self):
2146 # Incorrect SQL was being generated for certain types of exclude()

Callers

nothing calls this directly

Calls 4

get_compilerMethod · 0.80
filterMethod · 0.45
countMethod · 0.45
as_sqlMethod · 0.45

Tested by

no test coverage detected