From 928baee7478f2e1bd48fb8e0801f4f1ffc4f7aea Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 14 Aug 2012 21:17:25 +0200 Subject: [PATCH] [py3] Fixed conditional_processing tests --- django/utils/http.py | 4 +++- tests/regressiontests/conditional_processing/models.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/django/utils/http.py b/django/utils/http.py index 22e81a33d7..cdd56bfed1 100644 --- a/django/utils/http.py +++ b/django/utils/http.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + import calendar import datetime import re @@ -211,7 +213,7 @@ def parse_etags(etag_str): if not etags: # etag_str has wrong format, treat it as an opaque string then 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 def quote_etag(etag): diff --git a/tests/regressiontests/conditional_processing/models.py b/tests/regressiontests/conditional_processing/models.py index dacea34a83..d0838e153d 100644 --- a/tests/regressiontests/conditional_processing/models.py +++ b/tests/regressiontests/conditional_processing/models.py @@ -22,7 +22,7 @@ class ConditionalGet(TestCase): def assertFullResponse(self, response, check_last_modified=True, check_etag=True): self.assertEqual(response.status_code, 200) - self.assertEqual(response.content, FULL_RESPONSE) + self.assertEqual(response.content, FULL_RESPONSE.encode()) if check_last_modified: self.assertEqual(response['Last-Modified'], LAST_MODIFIED_STR) if check_etag: