From a8e4fd11efc65832e7d9f5582d3868c5c8bd8d88 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Wed, 1 Jan 2025 18:06:54 -0500 Subject: Fixed #36052 -- Supported CompositePrimaryKey in inspectdb. --- tests/inspectdb/tests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests') 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"], -- cgit v1.3