diff options
| author | Baptiste Mispelon <baptiste.mispelon@torchbox.com> | 2025-04-28 09:48:12 +0200 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2025-04-30 11:55:56 -0300 |
| commit | 1367a197dda2027e4fcf33e3053244fdcbda9d8c (patch) | |
| tree | 56b62850c96b51fe07f385be055bb2fce892ab66 /tests | |
| parent | ec73fd67466e0e4841d9ecd0f217c02ce842d860 (diff) | |
[5.2.x] 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>
Backport of 66f9eb0ff1e7147406318c5ba609729678e4e6f6 from main.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/inspectdb/tests.py | 5 |
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()) |
