summaryrefslogtreecommitdiff
path: root/tests/modeltests/str/models.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-11-27 09:45:37 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-11-27 09:55:26 +0100
commit71e5ad248e104f68a0d755cd5f76e86631607be5 (patch)
tree452f34c84d2e89ee67f226e7c46fb9aa8fd59517 /tests/modeltests/str/models.py
parent7c91b67cfaf4669df55a715e62d891faea796f20 (diff)
[1.5.x] Fixed #19362 -- Detected invalid use of @python_2_unicode_compatible.
Thanks m3wolf for the report and akaariai for reproducing the problem. Backport of 2ea80b9.
Diffstat (limited to 'tests/modeltests/str/models.py')
-rw-r--r--tests/modeltests/str/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/modeltests/str/models.py b/tests/modeltests/str/models.py
index 488012e861..1c158ea008 100644
--- a/tests/modeltests/str/models.py
+++ b/tests/modeltests/str/models.py
@@ -28,6 +28,14 @@ class Article(models.Model):
return self.headline
@python_2_unicode_compatible
+class BrokenArticle(models.Model):
+ headline = models.CharField(max_length=100)
+ pub_date = models.DateTimeField()
+
+ def __unicode__(self): # instead of __str__
+ return self.headline
+
+@python_2_unicode_compatible
class InternationalArticle(models.Model):
headline = models.CharField(max_length=100)
pub_date = models.DateTimeField()