MCPcopy
hub / github.com/django/django / test_query_encoding

Method test_query_encoding

tests/backends/tests.py:92–100  ·  view source on GitHub ↗

last_executed_query() returns a string.

(self)

Source from the content-addressed store, hash-verified

90 self.assertIn(Reporter._meta.db_table, sql)
91
92 def test_query_encoding(self):
93 """last_executed_query() returns a string."""
94 data = RawData.objects.filter(raw_data=b"\x00\x46 \xfe").extra(
95 select={"föö": 1}
96 )
97 sql, params = data.query.sql_with_params()
98 with data.query.get_compiler("default").execute_sql(CURSOR) as cursor:
99 last_sql = cursor.db.ops.last_executed_query(cursor, sql, params)
100 self.assertIsInstance(last_sql, str)
101
102 def test_last_executed_query(self):
103 # last_executed_query() interpolate all parameters, in most cases it is

Callers

nothing calls this directly

Calls 6

sql_with_paramsMethod · 0.80
get_compilerMethod · 0.80
extraMethod · 0.45
filterMethod · 0.45
execute_sqlMethod · 0.45
last_executed_queryMethod · 0.45

Tested by

no test coverage detected