summaryrefslogtreecommitdiff
path: root/django/test/utils.py
diff options
context:
space:
mode:
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):
"""