~unifield-team/unifield-wm/us-671-homere

« back to all changes in this revision

Viewing changes to unifield_tests/README

  • Committer: jf
  • Date: 2012-04-17 15:29:16 UTC
  • mfrom: (631.3.7 UF_828)
  • Revision ID: jf@tempo4-20120417152916-svm6ioq8ur2bi5tu
UF-955 [DEV] Reporting (Month-end) - 2 remaining reports
lp:~unifield-team/unifield-wm/UF_955

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Requirement
2
 
 
3
 
You need a synchronization environment with these databases:
4
 
 
5
 
  * hq
6
 
  * coordo
7
 
  * project
8
 
  * sync server
9
 
  * [optional] remote warehouse
10
 
 
11
 
You can generate a synchronization environment by using the famous *mkdb.py* script. Either with sync_module_prod branch or sync-env branch.
12
 
 
13
 
If you use sync_module_prod branch, change *unifield.config* file with this parameter:
14
 
 
15
 
    tempo_mkdb: 0
16
 
 
17
 
If not, use this:
18
 
 
19
 
    tempo_mkdb: 1
20
 
 
21
 
And it will do the trick.
22
 
 
23
 
# Use it!
24
 
 
25
 
To use PyUnit tests in this directory:
26
 
 
27
 
    python test_runner.py
28
 
 
29
 
# What does the script?
30
 
 
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
35
 
 
36
 
# Remote warehouse
37
 
 
38
 
## Activate tests
39
 
 
40
 
To test remote warehouse, be sure to add a parameter like that (in *unifield.config*):
41
 
 
42
 
    RW: HQ1C1P1_RW
43
 
 
44
 
This way, it will activate remote warehouse tests.
45
 
 
46
 
## Develop remote warehouse tests
47
 
 
48
 
In class you make to test remote warehouse, be sure to have this method:
49
 
 
50
 
```
51
 
  def setUp(self):
52
 
        if not self.is_remote_warehouse:
53
 
            raise UserWarning("Remote Warehouse deactivated. This test will be not achieve.")
54
 
```
55
 
 
56
 
Without this, all tests will be executed during the main TestSuite.
57
 
 
58
 
# Notes
59
 
 
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