summaryrefslogtreecommitdiff
path: root/tests/regressiontests/httpwrappers
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-04-26 13:30:48 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-04-26 13:30:48 +0000
commit439cb4047fb583d08149f28e2ce66a8edfe0efa7 (patch)
tree47ef30e70bf1d757f08b133d3aa47704db13c714 /tests/regressiontests/httpwrappers
parent6c02565e4fb92c4cc3bfb45bcc89eb9aa299efdc (diff)
Fixed #4040 -- Changed uses of has_key() to "in". Slight performance
improvement and forward-compatible with future Python releases. Patch from Gary Wilson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/httpwrappers')
-rw-r--r--tests/regressiontests/httpwrappers/tests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py
index 385c3048d9..29cb8385e0 100644
--- a/tests/regressiontests/httpwrappers/tests.py
+++ b/tests/regressiontests/httpwrappers/tests.py
@@ -34,6 +34,9 @@ AttributeError: This QueryDict instance is immutable
>>> q.has_key('foo')
False
+>>> 'foo' in q
+False
+
>>> q.items()
[]
@@ -124,6 +127,9 @@ MultiValueDictKeyError: "Key 'foo' not found in <MultiValueDict: {}>"
>>> q.has_key('foo')
True
+>>> 'foo' in q
+True
+
>>> q.items()
[('foo', 'another'), ('name', 'john')]
@@ -218,9 +224,15 @@ AttributeError: This QueryDict instance is immutable
>>> q.has_key('foo')
True
+>>> 'foo' in q
+True
+
>>> q.has_key('bar')
False
+>>> 'bar' in q
+False
+
>>> q.items()
[('foo', 'bar')]
@@ -303,9 +315,15 @@ AttributeError: This QueryDict instance is immutable
>>> q.has_key('vote')
True
+>>> 'vote' in q
+True
+
>>> q.has_key('foo')
False
+>>> 'foo' in q
+False
+
>>> q.items()
[('vote', 'no')]