summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2012-03-03 19:02:49 +0000
committerJannis Leidel <jannis@leidel.info>2012-03-03 19:02:49 +0000
commitc988397279147b9d38c5b3feed9647c586fa049a (patch)
treea4aede19b7a5e69718ddbf7c92a12633abbfa255 /tests
parentdc49e6143a1e3cfafa4b7b41e4ab3c86d3e68918 (diff)
Fixed #10498 -- Fixed using ugettext_lazy values when creating model instances. Thanks to Claude Paroz and Jonas Obrist.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17641 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/many_to_one/tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/modeltests/many_to_one/tests.py b/tests/modeltests/many_to_one/tests.py
index bc9fe64be4..d9d67bbb98 100644
--- a/tests/modeltests/many_to_one/tests.py
+++ b/tests/modeltests/many_to_one/tests.py
@@ -5,6 +5,7 @@ from datetime import datetime
from django.core.exceptions import MultipleObjectsReturned
from django.test import TestCase
+from django.utils.translation import ugettext_lazy
from .models import Article, Reporter
@@ -412,3 +413,14 @@ class ManyToOneTests(TestCase):
# Same as each other
self.assertTrue(r1.article_set.__class__ is r2.article_set.__class__)
+
+ def test_create_relation_with_ugettext_lazy(self):
+ reporter = Reporter.objects.create(first_name='John',
+ last_name='Smith',
+ email='john.smith@example.com')
+ lazy = ugettext_lazy(u'test')
+ reporter.article_set.create(headline=lazy,
+ pub_date=datetime(2011, 6, 10))
+ notlazy = unicode(lazy)
+ article = reporter.article_set.get()
+ self.assertEqual(article.headline, notlazy)