Index: django/utils/datastructures.py
===================================================================
--- django/utils/datastructures.py	(revision 4936)
+++ django/utils/datastructures.py	(working copy)
@@ -99,6 +99,14 @@
         obj.keyOrder = self.keyOrder
         return obj
 
+    def __repr__(self):
+        '''Returns string representation of d.  The Python default for dicts
+        doesn't seem to use keys().  We just re-implement it as an iterator
+        over self so that the representation appears to have the correct order.
+        '''
+        return '{%s}' % ', '.join(
+          '%s: %s' % (repr(k), repr(self[k])) for k in self)
+
 class MultiValueDictKeyError(KeyError):
     pass
 
