Skip to content

Commit 006c2b8

Browse files
committed
Fixed django#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.
1 parent eb0140b commit 006c2b8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ answer newbie questions, and generally made Django that much better:
347347
Frantisek Malina <vizualbod@vizualbod.com>
348348
Mike Malone <mjmalone@gmail.com>
349349
Martin Maney <http://www.chipy.org/Martin_Maney>
350+
Michael Manfre <mmanfre@gmail.com>
350351
masonsimon+django@gmail.com
351352
Manuzhai
352353
Petr Marhoun <petr.marhoun@gmail.com>

tests/regressiontests/servers/tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,23 @@ def test_view(self):
113113
Refs #2879.
114114
"""
115115
f = self.urlopen('/example_view/')
116-
self.assertEqual(f.read(), 'example view')
116+
self.assertEqual(f.read(), b'example view')
117117

118118
def test_static_files(self):
119119
"""
120120
Ensure that the LiveServerTestCase serves static files.
121121
Refs #2879.
122122
"""
123123
f = self.urlopen('/static/example_static_file.txt')
124-
self.assertEqual(f.read(), 'example static file\n')
124+
self.assertEqual(f.read().rstrip(b'\r\n'), b'example static file')
125125

126126
def test_media_files(self):
127127
"""
128128
Ensure that the LiveServerTestCase serves media files.
129129
Refs #2879.
130130
"""
131131
f = self.urlopen('/media/example_media_file.txt')
132-
self.assertEqual(f.read(), 'example media file\n')
132+
self.assertEqual(f.read().rstrip(b'\r\n'), b'example media file')
133133

134134

135135
class LiveServerDatabase(LiveServerBase):

0 commit comments

Comments
 (0)