• Arnaud Fontaine's avatar
    py3: TestTradeModelLineMixin inherited from UserDict() to store values on the... · 57c609da
    Arnaud Fontaine authored
    py3: TestTradeModelLineMixin inherited from UserDict() to store values on the class direcly (!1751).
    
    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...
    57c609da
test.erp5.testTradeModelLine.py 58.8 KB