MCPcopy
hub / github.com/django/django / test_namespaced_db_table_create_index_name

Method test_namespaced_db_table_create_index_name

tests/schema/tests.py:5564–5577  ·  view source on GitHub ↗

Table names are stripped of their namespace/schema before being used to generate index names.

(self)

Source from the content-addressed store, hash-verified

5562 )
5563
5564 def test_namespaced_db_table_create_index_name(self):
5565 """
5566 Table names are stripped of their namespace/schema before being used to
5567 generate index names.
5568 """
5569 with connection.schema_editor() as editor:
5570 max_name_length = connection.ops.max_name_length() or 200
5571 namespace = "n" * max_name_length
5572 table_name = "t" * max_name_length
5573 namespaced_table_name = '"%s"."%s"' % (namespace, table_name)
5574 self.assertEqual(
5575 editor._create_index_name(table_name, []),
5576 editor._create_index_name(namespaced_table_name, []),
5577 )
5578
5579 @unittest.skipUnless(
5580 connection.vendor == "oracle", "Oracle specific db_table syntax"

Callers

nothing calls this directly

Calls 3

schema_editorMethod · 0.80
_create_index_nameMethod · 0.80
max_name_lengthMethod · 0.45

Tested by

no test coverage detected