From 861c04fb7ecfed5dcf78999ca7754d631f679d83 Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Sun, 27 Jun 2010 19:55:39 -0300 Subject: [PATCH] made encoding explicit in test_get_meta_refresh, to avoid depending on unreliable UnicodeDammit criteria. --- scrapy/tests/test_utils_response.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scrapy/tests/test_utils_response.py b/scrapy/tests/test_utils_response.py index 231969f0a..3337b80d6 100644 --- a/scrapy/tests/test_utils_response.py +++ b/scrapy/tests/test_utils_response.py @@ -96,12 +96,12 @@ class ResponseUtilsTest(unittest.TestCase): response = TextResponse(url='http://example.com', body=body, encoding='utf-16') self.assertEqual(get_meta_refresh(response), (3, 'http://example.com/redirect')) - # non-ascii chars in the url (default encoding - utf8) + # non-ascii chars in the url (utf8) body = """""" - response = TextResponse(url='http://example.com', body=body) + response = TextResponse(url='http://example.com', body=body, encoding='utf-8') self.assertEqual(get_meta_refresh(response), (3, 'http://example.com/to%C2%A3')) - # non-ascii chars in the url (custom encoding - latin1) + # non-ascii chars in the url (latin1) body = """""" response = TextResponse(url='http://example.com', body=body, encoding='latin1') self.assertEqual(get_meta_refresh(response), (3, 'http://example.com/to%C2%A3'))