MCPcopy
hub / github.com/django/django / setUp

Method setUp

tests/backends/test_ddl_references.py:261–273  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

259 available_apps = []
260
261 def setUp(self):
262 compiler = Person.objects.all().query.get_compiler(connection.alias)
263 self.editor = connection.schema_editor()
264 self.expressions = Expressions(
265 table=Person._meta.db_table,
266 expressions=ExpressionList(
267 IndexExpression(F("first_name")),
268 IndexExpression(F("last_name").desc()),
269 IndexExpression(Upper("last_name")),
270 ).resolve_expression(compiler.query),
271 compiler=compiler,
272 quote_value=self.editor.quote_value,
273 )
274
275 def test_references_table(self):
276 self.assertIs(self.expressions.references_table(Person._meta.db_table), True)

Callers

nothing calls this directly

Calls 10

ExpressionsClass · 0.90
ExpressionListClass · 0.90
IndexExpressionClass · 0.90
FClass · 0.90
UpperClass · 0.90
get_compilerMethod · 0.80
schema_editorMethod · 0.80
allMethod · 0.45
resolve_expressionMethod · 0.45
descMethod · 0.45

Tested by

no test coverage detected