Commit 2b898bc8 authored by Carlos Ramos Carreño's avatar Carlos Ramos Carreño Committed by Jérome Perrin

Fix accounting tests in Python 2.

An unicode encoding error was being raised in
test_AccountingTransaction_getListBoxColumnList_item_column in Python 2,
when the `html` variable was being passed to the `StringIO`
constructor. The error was only reproducible when running the tests in
the CLI.

The problem was that we were using cStringIO module in Python 2, and the
string فارسی (farsi) appears in the HTML (probably inside a language
picker). cStringIO cannot parse unicode characters that are non-ASCII.
The solution is to use "six.StringIO", which uses the (slower,
but unicode-compatible) StringIO module in Python 2.
parent 37406d0a
......@@ -30,7 +30,7 @@
"""
from six.moves import cStringIO as StringIO
from six import StringIO
import lxml
from DateTime import DateTime
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment