Yann Malet  committed df40ddb

Add a workaround to backort a bug in django1.1.1 and earlier. The bug is located in django test client

  • Participants
  • Parent commits 7825fa2

Comments (0)

Files changed (1)

File multilingual_cache/utils/

 An example: i18n middleware would need to distinguish caches by the
 "Accept-language" header.
+from Cookie import SimpleCookie
 import re
 import time
     for header in headerlist:
         value = request.META.get(header, None)
         if value is not None:
-            ctx.update(value)
+            #Temporary fix to workaround a bug in the test client
+            # of django 1.1.1 and before
+            if type(value) == SimpleCookie:
+                ctx.update(value.output(header='', sep='; '))
+            else:
+                ctx.update(value)
     path = md5_constructor(iri_to_uri(request.path))
     cache_key = 'views.decorators.cache.cache_page.%s.%s.%s' % (
         key_prefix, path.hexdigest(), ctx.hexdigest())