MCPcopy
hub / github.com/django/django / test_col_alias_quoted

Method test_col_alias_quoted

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

Source from the content-addressed store, hash-verified

2217 )
2218
2219 def test_col_alias_quoted(self):
2220 with CaptureQueriesContext(connection) as captured_queries:
2221 self.assertEqual(
2222 Tag.objects.values("parent")
2223 .annotate(
2224 tag_per_parent=Count("pk"),
2225 )
2226 .aggregate(Max("tag_per_parent")),
2227 {"tag_per_parent__max": 2},
2228 )
2229 sql = captured_queries[0]["sql"]
2230 self.assertIn("AS %s" % connection.ops.quote_name("parent"), sql)
2231
2232 def test_xor_subquery(self):
2233 self.assertSequenceEqual(

Callers

nothing calls this directly

Calls 7

CountClass · 0.90
MaxClass · 0.90
aggregateMethod · 0.80
annotateMethod · 0.80
valuesMethod · 0.45
quote_nameMethod · 0.45

Tested by

no test coverage detected