Document FTP: fix yaml tests.
[odoo/odoo.git] / addons / document_ftp / test / document_ftp_test4.yml
1 -
2     In order to check dynamic folder functionality of document + FTP
3 - |
4     I create two partners 'Partner1' and 'Partner2'.
5     I create three partner categories: 'none', 'pat1' and 'all'
6     I attach Partner1 to pat1, Partner1+Partner2 to 'all'
7 -
8     !record {model: res.partner.category, id: tpat_categ_none }:
9         name: 'No partners'
10 -
11     !record {model: res.partner.category, id: tpat_categ_pat1 }:
12         name: 'Pat 1'
13 -
14     !record {model: res.partner.category, id: tpat_categ_all }:
15         name: 'All Partner1+2'
16 -
17     !record {model: res.partner, id: tpartner1 }:
18         name: Partner 1
19         category_id:
20             - tpat_categ_pat1
21             - tpat_categ_all
22 -
23     !record {model: res.partner, id: tpartner_2 }:
24         name: 'Partner 2'
25         category_id:
26             - tpat_categ_all
27 -
28     I create a resource folder of partners, by the (none, pat1, all) 
29     categories.
30 -
31     !record {model: document.directory, id: dir_tests2 }:
32         name: Partners Testing
33         parent_id: document.dir_root
34         type: ressource
35         ressource_type_id: base.model_res_partner_category
36         domain: []
37 -
38     I commit (because FTP operations are on different transaction)
39 -
40     !python {model: document.directory, id: }: |
41         cr.commit()
42 -
43     I browse through ftp in the resource folder, checking that three
44     categories are there.
45 -
46     !python {model: ir.attachment}: |
47         from document_ftp import test_easyftp as te
48         ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Partners Testing')
49         dirs = ftp.nlst()
50         dirs.sort()
51         assert dirs == [ 'All Partner1+2', 'No partners', 'Pat 1' ]
52 -
53     I create a 'partners' folder by the first resource one.
54 -
55     I check through FTP that the correct partners are listed at each
56     'partners' folder.
57 -
58     I create an ir.attachment, attached (not related) to Partner1
59     
60 -
61     I check that pat1/Partner1 folder has the file.
62     I check that all/Partner1 folder has the file
63 -
64     I place a file at the 'pat1'/Partner1 folder, through FTP
65 -
66     I check at the server that the file is attached to Partner1
67 -
68     I check that all/Partner1 also has the file
69 - |
70     Bonus Piste:
71     I create a 'Partner3' under 'all'
72 -