mirror of
https://github.com/django/django.git
synced 2025-10-17 22:07:29 +00:00
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
This commit is contained in:
parent
87d55081ea
commit
c2e70f0265
176 changed files with 1525 additions and 1008 deletions
|
@ -187,7 +187,7 @@ class ForeignKeyTests(test.TestCase):
|
|||
|
||||
def test_warning_when_unique_true_on_fk(self):
|
||||
class FKUniqueTrue(models.Model):
|
||||
fk_field = models.ForeignKey(Foo, unique=True)
|
||||
fk_field = models.ForeignKey(Foo, models.CASCADE, unique=True)
|
||||
|
||||
model = FKUniqueTrue()
|
||||
expected_warnings = [
|
||||
|
@ -213,7 +213,7 @@ class ForeignKeyTests(test.TestCase):
|
|||
pending_ops_before = list(apps._pending_operations.items())
|
||||
|
||||
class AbstractForeignKeyModel(models.Model):
|
||||
fk = models.ForeignKey('missing.FK')
|
||||
fk = models.ForeignKey('missing.FK', models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -235,7 +235,7 @@ class ManyToManyFieldTests(test.SimpleTestCase):
|
|||
pending_ops_before = list(apps._pending_operations.items())
|
||||
|
||||
class AbstractManyToManyModel(models.Model):
|
||||
fk = models.ForeignKey('missing.FK')
|
||||
fk = models.ForeignKey('missing.FK', models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue