Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[py3] Fixed conditional_processing tests

  • Loading branch information...
commit 928baee7478f2e1bd48fb8e0801f4f1ffc4f7aea 1 parent 0120985
Claude Paroz authored August 14, 2012
4  django/utils/http.py
... ...
@@ -1,3 +1,5 @@
  1
+from __future__ import unicode_literals
  2
+
1 3
 import calendar
2 4
 import datetime
3 5
 import re
@@ -211,7 +213,7 @@ def parse_etags(etag_str):
211 213
     if not etags:
212 214
         # etag_str has wrong format, treat it as an opaque string then
213 215
         return [etag_str]
214  
-    etags = [e.decode('string_escape') for e in etags]
  216
+    etags = [e.encode('ascii').decode('unicode_escape') for e in etags]
215 217
     return etags
216 218
 
217 219
 def quote_etag(etag):
2  tests/regressiontests/conditional_processing/models.py
@@ -22,7 +22,7 @@ class ConditionalGet(TestCase):
22 22
 
23 23
     def assertFullResponse(self, response, check_last_modified=True, check_etag=True):
24 24
         self.assertEqual(response.status_code, 200)
25  
-        self.assertEqual(response.content, FULL_RESPONSE)
  25
+        self.assertEqual(response.content, FULL_RESPONSE.encode())
26 26
         if check_last_modified:
27 27
             self.assertEqual(response['Last-Modified'], LAST_MODIFIED_STR)
28 28
         if check_etag:

0 notes on commit 928baee

Please sign in to comment.
Something went wrong with that request. Please try again.