diff --git a/tests/regressiontests/pickle/__init__.py b/tests/regressiontests/pickle/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/regressiontests/pickle/models.py b/tests/regressiontests/pickle/models.py
new file mode 100644
index 0000000..9b20f29
-
|
+
|
|
| 1 | from django.db import models |
| 2 | from django.utils.translation import ugettext_lazy as _ |
| 3 | |
| 4 | class PickleMe(models.Model): |
| 5 | name = models.CharField(_("Name"), max_length=10) |
diff --git a/tests/regressiontests/pickle/tests.py b/tests/regressiontests/pickle/tests.py
new file mode 100644
index 0000000..de70649
-
|
+
|
|
| 1 | import unittest |
| 2 | import pickle |
| 3 | |
| 4 | from models import PickleMe |
| 5 | |
| 6 | class PickleUgettextLazyTest(unittest.TestCase): |
| 7 | def test_pickle_ugettext_lazy(self): |
| 8 | qs1 = PickleMe.objects.filter(name__icontains="pickle") |
| 9 | query_pickled = pickle.dumps(qs1.query) |
| 10 | |
| 11 | qs2 = PickleMe.objects.all() |
| 12 | qs2.query = pickle.loads(query_pickled) |
| 13 | |
| 14 | self.assertEquals(str(qs1.query), str(qs2.query)) |