summaryrefslogtreecommitdiff
path: root/tests/regressiontests/utils/functional.py
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2010-01-05 13:20:19 +0000
committerLuke Plant <L.Plant.98@cantab.net>2010-01-05 13:20:19 +0000
commit3de16688a93d64154dea1f5517d3e9e80b97b080 (patch)
treecd328ad314bd3578e238a967f603a660e5b096fb /tests/regressiontests/utils/functional.py
parentd4f9bff7ef190fdaedaa5319718f1db265d86d56 (diff)
[1.1.X] Fixed #12506 - 'lazy' fails when there are multiple expected classes with the same method
Thanks to Alex for report and patch Backport of r12104 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12105 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/utils/functional.py')
-rw-r--r--tests/regressiontests/utils/functional.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/regressiontests/utils/functional.py b/tests/regressiontests/utils/functional.py
new file mode 100644
index 0000000000..72610154d8
--- /dev/null
+++ b/tests/regressiontests/utils/functional.py
@@ -0,0 +1,10 @@
+from unittest import TestCase
+
+from django.utils.functional import lazy
+
+
+class FunctionalTestCase(TestCase):
+ def test_lazy(self):
+ t = lazy(lambda: tuple(range(3)), list, tuple)
+ for a, b in zip(t(), range(3)):
+ self.assertEqual(a, b)