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.
This commit is contained in:
Claude Paroz 2012-05-17 11:05:38 +02:00
parent eb0140bddc
commit 006c2b8fc1
2 changed files with 4 additions and 3 deletions

View File

@ -347,6 +347,7 @@ answer newbie questions, and generally made Django that much better:
Frantisek Malina <vizualbod@vizualbod.com> Frantisek Malina <vizualbod@vizualbod.com>
Mike Malone <mjmalone@gmail.com> Mike Malone <mjmalone@gmail.com>
Martin Maney <http://www.chipy.org/Martin_Maney> Martin Maney <http://www.chipy.org/Martin_Maney>
Michael Manfre <mmanfre@gmail.com>
masonsimon+django@gmail.com masonsimon+django@gmail.com
Manuzhai Manuzhai
Petr Marhoun <petr.marhoun@gmail.com> Petr Marhoun <petr.marhoun@gmail.com>

View File

@ -113,7 +113,7 @@ class LiveServerViews(LiveServerBase):
Refs #2879. Refs #2879.
""" """
f = self.urlopen('/example_view/') f = self.urlopen('/example_view/')
self.assertEqual(f.read(), 'example view') self.assertEqual(f.read(), b'example view')
def test_static_files(self): def test_static_files(self):
""" """
@ -121,7 +121,7 @@ class LiveServerViews(LiveServerBase):
Refs #2879. Refs #2879.
""" """
f = self.urlopen('/static/example_static_file.txt') 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): def test_media_files(self):
""" """
@ -129,7 +129,7 @@ class LiveServerViews(LiveServerBase):
Refs #2879. Refs #2879.
""" """
f = self.urlopen('/media/example_media_file.txt') 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): class LiveServerDatabase(LiveServerBase):