mirror of
https://github.com/django/django.git
synced 2025-11-25 13:13:28 +00:00
Tests regression in 4c75858135.
This commit is contained in:
parent
1fb3f57e81
commit
dd133054cb
2 changed files with 3 additions and 3 deletions
|
|
@ -157,7 +157,7 @@ class DbComment(models.Model):
|
||||||
required_db_features = {"supports_comments"}
|
required_db_features = {"supports_comments"}
|
||||||
|
|
||||||
|
|
||||||
class CompositePrimaryKeyModel(models.Model):
|
class CompositePKModel(models.Model):
|
||||||
pk = models.CompositePrimaryKey("column_1", "column_2")
|
pk = models.CompositePrimaryKey("column_1", "column_2")
|
||||||
column_1 = models.IntegerField()
|
column_1 = models.IntegerField()
|
||||||
column_2 = models.IntegerField()
|
column_2 = models.IntegerField()
|
||||||
|
|
|
||||||
|
|
@ -629,7 +629,7 @@ class InspectDBTransactionalTests(TransactionTestCase):
|
||||||
def test_composite_primary_key(self):
|
def test_composite_primary_key(self):
|
||||||
out = StringIO()
|
out = StringIO()
|
||||||
field_type = connection.features.introspected_field_types["IntegerField"]
|
field_type = connection.features.introspected_field_types["IntegerField"]
|
||||||
call_command("inspectdb", "inspectdb_compositeprimarykeymodel", stdout=out)
|
call_command("inspectdb", "inspectdb_compositepkmodel", stdout=out)
|
||||||
output = out.getvalue()
|
output = out.getvalue()
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"pk = models.CompositePrimaryKey('column_1', 'column_2')",
|
"pk = models.CompositePrimaryKey('column_1', 'column_2')",
|
||||||
|
|
@ -640,5 +640,5 @@ class InspectDBTransactionalTests(TransactionTestCase):
|
||||||
|
|
||||||
def test_composite_primary_key_not_unique_together(self):
|
def test_composite_primary_key_not_unique_together(self):
|
||||||
out = StringIO()
|
out = StringIO()
|
||||||
call_command("inspectdb", "inspectdb_compositeprimarykeymodel", stdout=out)
|
call_command("inspectdb", "inspectdb_compositepkmodel", stdout=out)
|
||||||
self.assertNotIn("unique_together", out.getvalue())
|
self.assertNotIn("unique_together", out.getvalue())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue