[py3] Fixed conditional_processing tests

This commit is contained in:
Claude Paroz 2012-08-14 21:17:25 +02:00
parent 0120985095
commit 928baee747
2 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,5 @@
from __future__ import unicode_literals
import calendar import calendar
import datetime import datetime
import re import re
@ -211,7 +213,7 @@ def parse_etags(etag_str):
if not etags: if not etags:
# etag_str has wrong format, treat it as an opaque string then # etag_str has wrong format, treat it as an opaque string then
return [etag_str] return [etag_str]
etags = [e.decode('string_escape') for e in etags] etags = [e.encode('ascii').decode('unicode_escape') for e in etags]
return etags return etags
def quote_etag(etag): def quote_etag(etag):

View File

@ -22,7 +22,7 @@ class ConditionalGet(TestCase):
def assertFullResponse(self, response, check_last_modified=True, check_etag=True): def assertFullResponse(self, response, check_last_modified=True, check_etag=True):
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(response.content, FULL_RESPONSE) self.assertEqual(response.content, FULL_RESPONSE.encode())
if check_last_modified: if check_last_modified:
self.assertEqual(response['Last-Modified'], LAST_MODIFIED_STR) self.assertEqual(response['Last-Modified'], LAST_MODIFIED_STR)
if check_etag: if check_etag: