summaryrefslogtreecommitdiff
path: root/tests/inspectdb
diff options
context:
space:
mode:
authorBaptiste Mispelon <baptiste.mispelon@torchbox.com>2025-04-28 09:48:12 +0200
committernessita <124304+nessita@users.noreply.github.com>2025-04-30 11:55:25 -0300
commit66f9eb0ff1e7147406318c5ba609729678e4e6f6 (patch)
tree37d90058e70e6276142fef6ec7a73d5baf6cb666 /tests/inspectdb
parent07100db6f46255ec6ef70b860495f977473684d6 (diff)
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>
Diffstat (limited to 'tests/inspectdb')
-rw-r--r--tests/inspectdb/tests.py5
1 files changed, 5 insertions, 0 deletions
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())