Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

magic-removal: Fixed #1141 -- Fixed unit-test failures in [1799]. Tha…

…nks, Russ

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1801 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9d5272d61d33f1027c60699c9886f5da6b5dde29 1 parent a22a7ff
@adrianholovaty adrianholovaty authored
View
10 django/utils/datastructures.py
@@ -74,7 +74,7 @@ def __getitem__(self, key):
try:
list_ = dict.__getitem__(self, key)
except KeyError:
- raise MultiValueDictKeyError, "Key %r not found in MultiValueDict %r" % (key, self)
+ raise MultiValueDictKeyError, "Key %r not found in %r" % (key, self)
try:
return list_[-1]
except IndexError:
@@ -189,10 +189,10 @@ def __init__(self, key_to_list_mapping):
current[bits[-1]] = v
except TypeError: # Special-case if current isn't a dict.
current = {bits[-1] : v}
-
-def dot_expand(key_to_list_mapping, dict_factory=dict):
+
+def dot_expand(key_to_list_mapping, dict_factory=dict):
top = dict_factory()
-
+
for k, v in key_to_list_mapping.items():
current = top
bits = k.split('.')
@@ -203,4 +203,4 @@ def dot_expand(key_to_list_mapping, dict_factory=dict):
current[bits[-1]] = v
except TypeError: # Special-case if current isn't a dict.
current = dict_factory( (bits[-1], v) )
- return top
+ return top
View
6 tests/othertests/httpwrappers.py
@@ -8,7 +8,7 @@
>>> q['foo']
Traceback (most recent call last):
...
-MultiValueDictKeyError: "Key 'foo' not found in MultiValueDict {}"
+MultiValueDictKeyError: "Key 'foo' not found in <MultiValueDict: {}>"
>>> q['something'] = 'bar'
Traceback (most recent call last):
@@ -86,7 +86,7 @@
>>> q['foo']
Traceback (most recent call last):
...
-MultiValueDictKeyError: "Key 'foo' not found in MultiValueDict {}"
+MultiValueDictKeyError: "Key 'foo' not found in <MultiValueDict: {}>"
>>> q['name'] = 'john'
@@ -186,7 +186,7 @@
>>> q['bar']
Traceback (most recent call last):
...
-MultiValueDictKeyError: "Key 'bar' not found in MultiValueDict {'foo': ['bar']}"
+MultiValueDictKeyError: "Key 'bar' not found in <MultiValueDict: {'foo': ['bar']}>"
>>> q['something'] = 'bar'
Traceback (most recent call last):
Please sign in to comment.
Something went wrong with that request. Please try again.