From 66f9eb0ff1e7147406318c5ba609729678e4e6f6 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Mon, 28 Apr 2025 09:48:12 +0200 Subject: Fixed #36357 -- Skipped unique_together in inspectdb output for composite primary keys. Thanks to Baptiste Mispelon for the report and quick fix, and to Simon Charette and Jacob Walls for the reviews. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com> --- tests/inspectdb/tests.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/inspectdb/tests.py b/tests/inspectdb/tests.py index 8c544c58c3..db9e36c5f6 100644 --- a/tests/inspectdb/tests.py +++ b/tests/inspectdb/tests.py @@ -637,3 +637,8 @@ class InspectDBTransactionalTests(TransactionTestCase): ) self.assertIn(f"column_1 = models.{field_type}()", output) self.assertIn(f"column_2 = models.{field_type}()", output) + + def test_composite_primary_key_not_unique_together(self): + out = StringIO() + call_command("inspectdb", "inspectdb_compositeprimarykeymodel", stdout=out) + self.assertNotIn("unique_together", out.getvalue()) -- cgit v1.3