Commit 77aa1da8 authored by Arnaud Fontaine's avatar Arnaud Fontaine

py3: TestTradeModelLineMixin inherited from UserDict() to store values on the class direcly.

This does not work with py3:
    File "parts/erp5/Products/ERP5Type/tests/runUnitTest.py", line 941, in main
      result = runUnitTestList(test_list=args,
    File "parts/erp5/Products/ERP5Type/tests/runUnitTest.py", line 703, in runUnitTestList
      result = TestRunner(verbosity=verbosity).run(suite)
    [...]
    File "parts/python3/lib/python3.9/unittest/runner.py", line 184, in run
      test(result)
    [...]
    File "parts/python3/lib/python3.9/unittest/suite.py", line 84, in __call__
      return self.run(*args, **kwds)
    File "parts/python3/lib/python3.9/unittest/suite.py", line 111, in run
      if _isnotsuite(test):
    File "parts/python3/lib/python3.9/unittest/suite.py", line 369, in _isnotsuite
      iter(test)
    File "parts/python3/lib/python3.9/collections/__init__.py", line 1067, in __iter__
      return iter(self.data)
  AttributeError: 'TestComplexTradeModelLineUseCaseSale' object has no attribute 'data'

Use a dedicated dict() to store these values as there was no strong reasons to
inherit from UserDict() here and this makes test implementation easier too...
parent e60f3fb8
......@@ -54,7 +54,7 @@ class TestSimulationPerformance(TestTradeModelLineSale):
def perf_00_setupAndFillCache(self):
self.test_01_OrderWithSimpleTaxedAndDiscountedLines()
self.__class__._order = self['order'].getRelativeUrl()
self.__class__._order = self._storage['order'].getRelativeUrl()
self.runAlarms()
def perf_01_invoiceSimpleOrder(self, order_count=1):
......
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