summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-08-13 12:09:20 +0200
committerClaude Paroz <claude@2xlibre.net>2012-08-13 12:56:59 +0200
commit45baaabafb6cf911afad9ec63c86753b284f7269 (patch)
tree4a6a1681bb58d066ce4fd134aa2a660667dbe90b /tests
parentd774ad752d9844cb7a28fe338d4d711c8576ee6f (diff)
[py3] Fixed encoding issues in cache key generation
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/cache/tests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py
index 8fc749aaa2..4ffca2d458 100644
--- a/tests/regressiontests/cache/tests.py
+++ b/tests/regressiontests/cache/tests.py
@@ -1308,7 +1308,7 @@ class CacheI18nTest(TestCase):
# This is tightly coupled to the implementation,
# but it's the most straightforward way to test the key.
tz = force_text(timezone.get_current_timezone_name(), errors='ignore')
- tz = tz.encode('ascii', 'ignore').replace(' ', '_')
+ tz = tz.encode('ascii', 'ignore').decode('ascii').replace(' ', '_')
response = HttpResponse()
key = learn_cache_key(request, response)
self.assertIn(tz, key, "Cache keys should include the time zone name when time zones are active")
@@ -1320,7 +1320,7 @@ class CacheI18nTest(TestCase):
request = self._get_request()
lang = translation.get_language()
tz = force_text(timezone.get_current_timezone_name(), errors='ignore')
- tz = tz.encode('ascii', 'ignore').replace(' ', '_')
+ tz = tz.encode('ascii', 'ignore').decode('ascii').replace(' ', '_')
response = HttpResponse()
key = learn_cache_key(request, response)
self.assertNotIn(lang, key, "Cache keys shouldn't include the language name when i18n isn't active")