3
You need a synchronization environment with these databases:
9
* [optional] remote warehouse
11
You can generate a synchronization environment by using the famous *mkdb.py* script. Either with sync_module_prod branch or sync-env branch.
13
If you use sync_module_prod branch, change *unifield.config* file with this parameter:
21
And it will do the trick.
25
To use PyUnit tests in this directory:
29
# What does the script?
31
* Read the 'tests' directory
32
* For each file that begins by "test_" and ends with ".py" read the get_test_class() method that return the class to use
33
* Create a Test Suite with all given class
34
* Run all tests and create an "output.html" file that contains the result
40
To test remote warehouse, be sure to add a parameter like that (in *unifield.config*):
44
This way, it will activate remote warehouse tests.
46
## Develop remote warehouse tests
48
In class you make to test remote warehouse, be sure to have this method:
52
if not self.is_remote_warehouse:
53
raise UserWarning("Remote Warehouse deactivated. This test will be not achieve.")
56
Without this, all tests will be executed during the main TestSuite.
60
* Tests should inherit from UnifieldTest or for another Class that inherits from UnifieldTest
61
* UnifieldTest class checks that "unifield_tests" module is loaded in order to check that some data are loaded
62
* Master data are loaded via the master_data directory and the "init_xml" value from __openerp__.py file
63
* Master data are not updated if you reload the script on same databases. So to be sure tests are OK, generate a new set of databases