diff options
author | Russell Keith-Magee <russell@keith-magee.com> | 2010-08-06 16:34:34 +0000 |
---|---|---|
committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-08-06 16:34:34 +0000 |
commit | 6eb7cd1af49950f9128b7867a8ce886223b47d4f (patch) | |
tree | e1716dbd7e1f718550b156a0d8cdf82d570c3caa /django/test/utils.py | |
parent | c4b6edf3b8b647e7ef43f1ba49a310fb93468919 (diff) | |
download | django-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.py | 6 |
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): """ |