Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • erp5 erp5
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 142
    • Merge requests 142
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • erp5erp5
  • Merge requests
  • !1914

Fix accounting tests in Python 2.

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Carlos Ramos Carreño requested to merge vnmabus/erp5:fix/accounting_tests_py2 into zope4py3 Apr 11, 2024
  • Overview 4
  • Commits 1
  • Pipelines 0
  • Changes 1

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.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/accounting_tests_py2
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7