From 006c2b8fc166e53d4ffccda9c42ef9fc109e1c8d Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 17 May 2012 11:05:38 +0200 Subject: [PATCH] Fixed #18326 -- Stripped ending chars in LiveServerViews tests. Ending chars might be different depending on git crlf setting. Thanks Michael Manfre for the report and the patch. --- AUTHORS | 1 + tests/regressiontests/servers/tests.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 7e771c2c4d..c52ca0b2eb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -347,6 +347,7 @@ answer newbie questions, and generally made Django that much better: Frantisek Malina Mike Malone Martin Maney + Michael Manfre masonsimon+django@gmail.com Manuzhai Petr Marhoun diff --git a/tests/regressiontests/servers/tests.py b/tests/regressiontests/servers/tests.py index 5d287a195b..9537e1feb3 100644 --- a/tests/regressiontests/servers/tests.py +++ b/tests/regressiontests/servers/tests.py @@ -113,7 +113,7 @@ class LiveServerViews(LiveServerBase): Refs #2879. """ f = self.urlopen('/example_view/') - self.assertEqual(f.read(), 'example view') + self.assertEqual(f.read(), b'example view') def test_static_files(self): """ @@ -121,7 +121,7 @@ class LiveServerViews(LiveServerBase): Refs #2879. """ f = self.urlopen('/static/example_static_file.txt') - self.assertEqual(f.read(), 'example static file\n') + self.assertEqual(f.read().rstrip(b'\r\n'), b'example static file') def test_media_files(self): """ @@ -129,7 +129,7 @@ class LiveServerViews(LiveServerBase): Refs #2879. """ f = self.urlopen('/media/example_media_file.txt') - self.assertEqual(f.read(), 'example media file\n') + self.assertEqual(f.read().rstrip(b'\r\n'), b'example media file') class LiveServerDatabase(LiveServerBase):