summaryrefslogtreecommitdiff
path: root/tests/order_with_respect_to
diff options
context:
space:
mode:
authorFlavio Curella <flavio.curella@gmail.com>2015-07-22 09:43:21 -0500
committerTim Graham <timograham@gmail.com>2015-07-27 18:28:13 -0400
commitc2e70f02653519db3a49cd48f5158ccad7434d25 (patch)
treec0f421a6b0c26a7716c380b3e360fecc74d553fb /tests/order_with_respect_to
parent87d55081ea398c65b2503d22ed3907a9175ec729 (diff)
downloaddjango-c2e70f02653519db3a49cd48f5158ccad7434d25.tar.gz
Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField
Diffstat (limited to 'tests/order_with_respect_to')
-rw-r--r--tests/order_with_respect_to/models.py4
-rw-r--r--tests/order_with_respect_to/tests.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/order_with_respect_to/models.py b/tests/order_with_respect_to/models.py
index 18dbd08dbc..7afc917b4b 100644
--- a/tests/order_with_respect_to/models.py
+++ b/tests/order_with_respect_to/models.py
@@ -14,7 +14,7 @@ class Question(models.Model):
@python_2_unicode_compatible
class Answer(models.Model):
text = models.CharField(max_length=200)
- question = models.ForeignKey(Question)
+ question = models.ForeignKey(Question, models.CASCADE)
class Meta:
order_with_respect_to = 'question'
@@ -26,7 +26,7 @@ class Answer(models.Model):
@python_2_unicode_compatible
class Post(models.Model):
title = models.CharField(max_length=200)
- parent = models.ForeignKey("self", related_name="children", null=True)
+ parent = models.ForeignKey("self", models.SET_NULL, related_name="children", null=True)
class Meta:
order_with_respect_to = "parent"
diff --git a/tests/order_with_respect_to/tests.py b/tests/order_with_respect_to/tests.py
index 60181cca4b..ff92fdb6fb 100644
--- a/tests/order_with_respect_to/tests.py
+++ b/tests/order_with_respect_to/tests.py
@@ -91,7 +91,7 @@ class OrderWithRespectToTests2(TestCase):
pass
class Foo(models.Model):
- bar = models.ForeignKey(Bar)
+ bar = models.ForeignKey(Bar, models.CASCADE)
order = models.OrderWrt()
class Meta: