mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
Refs #373 -- Errored when providing db_column to CompositePrimaryKey.
This commit is contained in:
@@ -43,6 +43,11 @@ class CompositePKChecksTests(TestCase):
|
||||
with self.assertRaisesMessage(ValueError, expected_message):
|
||||
models.CompositePrimaryKey("tenant_id", "id", db_default=models.F("id"))
|
||||
|
||||
def test_composite_pk_cannot_have_a_db_column(self):
|
||||
expected_message = "CompositePrimaryKey cannot have a db_column."
|
||||
with self.assertRaisesMessage(ValueError, expected_message):
|
||||
models.CompositePrimaryKey("tenant_id", "id", db_column="tenant_pk")
|
||||
|
||||
def test_composite_pk_cannot_be_editable(self):
|
||||
expected_message = "CompositePrimaryKey cannot be editable."
|
||||
with self.assertRaisesMessage(ValueError, expected_message):
|
||||
|
||||
Reference in New Issue
Block a user