summaryrefslogtreecommitdiff
path: root/tests/basic/models.py
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-05-20 18:45:24 +0300
committerAnssi Kääriäinen <akaariai@gmail.com>2013-05-20 18:50:40 +0300
commit266c0bb23e9d64c47ace4d162e582febd5a1e336 (patch)
tree3032806322f65e1aa04dd16e239966d3576fabf1 /tests/basic/models.py
parentc9a96075fa02b6d52bec748ffdfb413688a15774 (diff)
Fixed #20278 -- ensured .get() exceptions do not recurse infinitely
A regression caused by d5b93d3281fe93cbef5de84a52 made .get() error reporting recurse infinitely on certain rare conditions. Fixed this by not trying to print the given lookup kwargs.
Diffstat (limited to 'tests/basic/models.py')
-rw-r--r--tests/basic/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/basic/models.py b/tests/basic/models.py
index 660beddf49..1bffcb9cda 100644
--- a/tests/basic/models.py
+++ b/tests/basic/models.py
@@ -18,3 +18,11 @@ class Article(models.Model):
def __str__(self):
return self.headline
+
+@python_2_unicode_compatible
+class SelfRef(models.Model):
+ selfref = models.ForeignKey('self', null=True, blank=True,
+ related_name='+')
+
+ def __str__(self):
+ return SelfRef.objects.get(selfref=self).pk