I'm trying to run unit tests on my openERP module, but no matter what I write it doesnt show if the test passes or fails! Anyone know how to output the results of a test? (Using Windows OpenERP version 6.1)
My YAML test is:
-
I test the tests
-
!python {model: mymodelname}: |
assert False, "Testing False!"
assert True, "Testing True!"
The output when I reload the module with openerp-server.exe --update mymodule --log-level=test -dtestdb shows that the test ran but has no errors?!
... TEST testdb openerp.tools.yaml_import: I test the tests
What am I doing wrong?
Edit: ---------------------------------------------------------------------
Ok so after much fiddling with the !python, I tried out another test:
-
I test that the state
-
!assert {model: mymodel, id: mymodel_id}:
- state == 'badstate'
Which gave the expected failure:
WARNING demo_61 openerp.tools.yaml_import: Assertion "NONAME" FAILED
test: state == 'badstate'
values: ! active == badstate
So I'm guessing it is something wrong with my syntax which may work as expected in version 7.
Thanks for everyone's answers and help!