Skip to content

Commit 3dc6777

Browse files
committed
Fixed scrapy.utils.python unittests
1 parent ce8137b commit 3dc6777

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scrapy/tests/test_utils_python.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_str_to_unicode(self):
2323
self.assertRaises(TypeError, str_to_unicode, 423)
2424

2525
# check errors argument works
26-
self.assertEqual(str_to_unicode('a\xedb', 'utf-8', errors='replace'), u'a\ufffdb')
26+
assert u'\ufffd' in str_to_unicode('a\xedb', 'utf-8', errors='replace')
2727

2828
def test_unicode_to_str(self):
2929
# converting a unicode object to an utf-8 encoded string
@@ -39,7 +39,7 @@ def test_unicode_to_str(self):
3939
self.assertRaises(TypeError, unicode_to_str, unittest)
4040

4141
# check errors argument works
42-
(str_to_unicode('a\xedb', 'latin-', errors='replace'), u'a?b')
42+
assert '?' in unicode_to_str(u'a\ufffdb', 'latin-1', errors='replace')
4343

4444
def test_memoizemethod_noargs(self):
4545
class A(object):

0 commit comments

Comments
 (0)