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 b846fa2655..b24f2e8c80 100644
--- a/django/test/utils.py
+++ b/django/test/utils.py
@@ -74,6 +74,12 @@ class ContextList(list):
else:
return super(ContextList, self).__getitem__(key)
+ def get(self, key, default=None):
+ try:
+ return self.__getitem__(key)
+ except KeyError:
+ return default
+
def __contains__(self, key):
try:
self[key]