[Erp5-dev] testing framework

Bartek Gorny bartek at redpoint.mn.pl
Mon Jul 31 19:34:29 CEST 2006


Hello

I tried to write and run a unit test for ERP5, and it doesn't seem to
work as expected. The question is, what am I doing wrong?

Here is what I've done: I followed an example of testAccounting.py,
removed everything except getBusinessTemplateList and added one dummy
test function. That's all.

I placed the test and two files (framework.py and runUnitTest.py) in a
/test subdirectory, and run it with a command "./runUnitTest.py
testMyClasses".

The problem is that the logs say that all products and business
templates are sucessfully installed, then a site with an id like
erp5_portal_dd9a9b9b5ad09b83394306ac1ff29294 is created, and then
ActivityTool starts throwing exceptions "KeyError:
'erp5_portal_dd9a9b9b5ad09b83394306ac1ff29294'", and then, because
activities do not get off the queue, the test throws RuntimeError "tic
is looping forever".

What, then, is the proper way to write and run tests?

Bartek

-- 
"Software is largely a service industry operating under the persistent
but unfounded delusion that it is a manufacturing industry."
Eric S.Raymond, "The Magic Cauldron"



More information about the Erp5-dev mailing list