jeudi 28 mai 2015

How can I fix my failing test?

I inherited a django project and I'm running the tests for it on 2 Ubuntu machines. On one machine it works but on this other machine a test fails and it looks like it has to do with unicode and the locale for Swedish (SE) where the word "Förberedande" is not encoded the same in the assertion:

#711      test_personal_menu.test_courses_menu ... > /usr/lib/python2.7/unittest/case.py(412)fail()
-> raise self.failureException(msg)
(Pdb) u
> /usr/lib/python2.7/unittest/case.py(726)assertSequenceEqual()
-> self.fail(msg)
(Pdb) u
> /usr/lib/python2.7/unittest/case.py(744)assertListEqual()
-> self.assertSequenceEqual(list1, list2, msg, seq_type=list)
(Pdb) list1
[(u'F\xf6rberedande kurs i matematik (SF1624)', u'http://ift.tt/1GFBieT')]
(Pdb) list2
[(u'F\u0e23\u0e16rberedande kurs i matematik (SF1624)', u'http://ift.tt/1GFBieT')]
(Pdb) 

Could you please tell me what I can do about it?

Aucun commentaire:

Enregistrer un commentaire