summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-04-19 12:40:46 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-04-19 12:40:46 +0000
commitebfe9383bfbc53cb6c29e1170d99f64feb9ad010 (patch)
treefaf395369df77a95af3bdf02ddf9d8426a75dadf /tests
parent56eb340528d392612f3229b4bd8b7416553c3b15 (diff)
Fixed #13370 -- Corrected the handling of pickling for lazy() proxy objects. Thanks to Alex Gaynor for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13000 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/i18n/tests.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py
index 17e53dfa29..32c991a436 100644
--- a/tests/regressiontests/i18n/tests.py
+++ b/tests/regressiontests/i18n/tests.py
@@ -1,8 +1,9 @@
# -*- encoding: utf-8 -*-
+import datetime
+import decimal
import os
import sys
-import decimal
-import datetime
+import pickle
from django.template import Template, Context
from django.conf import settings
@@ -41,6 +42,12 @@ class TranslationTests(TestCase):
s4 = ugettext_lazy('Some other string')
self.assertEqual(False, s == s4)
+ def test_lazy_pickle(self):
+ s1 = ugettext_lazy("test")
+ self.assertEqual(unicode(s1), "test")
+ s2 = pickle.loads(pickle.dumps(s1))
+ self.assertEqual(unicode(s2), "test")
+
def test_string_concat(self):
"""
unicode(string_concat(...)) should not raise a TypeError - #4796