summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2025-01-01 18:06:54 -0500
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-01-03 16:28:21 +0100
commita8e4fd11efc65832e7d9f5582d3868c5c8bd8d88 (patch)
treefefd2c626c4dd5f9a16d63672c62df62204df6a5 /tests
parentddefc3fed1cf1f0d3fab455babbbc009b76e4196 (diff)
Fixed #36052 -- Supported CompositePrimaryKey in inspectdb.
Diffstat (limited to 'tests')
-rw-r--r--tests/inspectdb/tests.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/inspectdb/tests.py b/tests/inspectdb/tests.py
index 1be4efc430..131bd45ce8 100644
--- a/tests/inspectdb/tests.py
+++ b/tests/inspectdb/tests.py
@@ -655,11 +655,10 @@ class InspectDBTransactionalTests(TransactionTestCase):
call_command("inspectdb", table_name, stdout=out)
output = out.getvalue()
self.assertIn(
- f"column_1 = models.{field_type}(primary_key=True) # The composite "
- f"primary key (column_1, column_2) found, that is not supported. The "
- f"first column is selected.",
+ "pk = models.CompositePrimaryKey('column_1', 'column_2')",
output,
)
+ self.assertIn(f"column_1 = models.{field_type}()", output)
self.assertIn(
"column_2 = models.%s()"
% connection.features.introspected_field_types["IntegerField"],