summaryrefslogtreecommitdiff
path: root/django/test/utils.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-08-06 16:34:34 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-08-06 16:34:34 +0000
commit6eb7cd1af49950f9128b7867a8ce886223b47d4f (patch)
treee1716dbd7e1f718550b156a0d8cdf82d570c3caa /django/test/utils.py
parentc4b6edf3b8b647e7ef43f1ba49a310fb93468919 (diff)
downloaddjango-6eb7cd1af49950f9128b7867a8ce886223b47d4f.tar.gz
Fixed #13092 -- Added support for the "in" operator when dealing with context lists. Thanks to clelland for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/test/utils.py')
-rw-r--r--django/test/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/test/utils.py b/django/test/utils.py
index b6ab39901b..404d130297 100644
--- a/django/test/utils.py
+++ b/django/test/utils.py
@@ -19,6 +19,12 @@ class ContextList(list):
else:
return super(ContextList, self).__getitem__(key)
+ def __contains__(self, key):
+ try:
+ value = self[key]
+ except KeyError:
+ return False
+ return True
def instrumented_test_render(self, context):
"""