Merge pull request #417 from gurneyalex/7.0-fix_1311004_account_move_line_index-afe
[odoo/odoo.git] / addons / document_ftp / test / document_ftp_test3.yml
1 -
2     In order to check international character functionality
3 -
4     !python {model: ir.attachment}: |
5         from document_ftp import test_easyftp as te
6         ftp = te.get_plain_ftp(timeout=1.0)
7 -
8     I create in the server a folder called 'Äïêéìáóôéêüò ÖÜêåëëïò'
9 -
10     !record {model: document.directory, id: dir_itests }:
11         name: 'Äïêéìáóôéêüò ÖÜêåëëïò'
12         parent_id: document.dir_root
13 -
14     And then I create another folder, under it, through FTP
15 -
16     !python {model: ir.attachment}: |
17         cr.commit()
18         from document_ftp import test_easyftp as te
19         ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Äïêéìáóôéêüò ÖÜêåëëïò')
20         ftp.mkd("ÖÜêåëëïò áðü êÜôù")
21 -
22     I check that this folder exists at the server
23 -
24     !assert {model: document.directory, id: , search: "[('name','=','ÖÜêåëëïò áðü êÜôù')]" }:
25       - parent_id != False
26 -
27     I login with FTP and check that 'Äïêéìáóôéêüò ÖÜêåëëïò' is there
28 -
29     !python {model: ir.attachment}: |
30         from document_ftp import test_easyftp as te
31         ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Äïêéìáóôéêüò ÖÜêåëëïò/ÖÜêåëëïò áðü êÜôù')
32 -
33     I create a file named 'ÄïêéìÞ' into that folder
34 -
35     !python {model: ir.attachment}: |
36         from document_ftp import test_easyftp as te
37         from cStringIO import StringIO
38         ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Äïêéìáóôéêüò ÖÜêåëëïò/ÖÜêåëëïò áðü êÜôù')
39         fdata = StringIO('êåßìåíï ìå utf-8')
40         ftp.storbinary('STOR ÄïêéìÞ.txt', fdata)
41 -
42     I remove the 'ÄïêéìÞ.txt' file
43 -
44     !python {model: ir.attachment}: |
45         from document_ftp import test_easyftp as te
46         from cStringIO import StringIO
47         ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Äïêéìáóôéêüò ÖÜêåëëïò/ÖÜêåëëïò áðü êÜôù')
48         ftp.delete('ÄïêéìÞ.txt')
49 -
50     I rename 'ÖÜêåëëïò áðü êÜôù' into 'Üëëïò'
51 -
52     !python {model: ir.attachment}: |
53         from document_ftp import test_easyftp as te
54         ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Äïêéìáóôéêüò ÖÜêåëëïò')
55         ftp.rename("ÖÜêåëëïò áðü êÜôù", "Üëëïò")
56 -
57     I place a file 'file Ö3' in 'Üëëïò'
58 -
59     !python {model: ir.attachment}: |
60         from document_ftp import test_easyftp as te
61         from cStringIO import StringIO
62         ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Äïêéìáóôéêüò ÖÜêåëëïò/Üëëïò')
63         fdata = StringIO('êé Üëëï êåßìåíï')
64         ftp.storbinary('STOR file Ö3.txt', fdata)
65 -
66     I rename the file into file+range(1..200) (large filename)
67 -
68     !python {model: ir.attachment}: |
69         from document_ftp import test_easyftp as te
70         from cStringIO import StringIO
71         ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Äïêéìáóôéêüò ÖÜêåëëïò/Üëëïò')
72         vuvuzela = 'b'+''.join('z' * 200)+'!'
73         ftp.rename("file Ö3.txt", vuvuzela)
74 -
75     I delete the file with the large name
76 -
77     !python {model: ir.attachment}: |
78         from document_ftp import test_easyftp as te
79         from cStringIO import StringIO
80         ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Äïêéìáóôéêüò ÖÜêåëëïò/Üëëïò')
81         vuvuzela = 'b'+''.join('z' * 200)+'!'
82         ftp.delete(vuvuzela)
83
84 -
85     I delete the testing folders
86 -
87     !python {model: ir.attachment}: |
88         from document_ftp import test_easyftp as te
89         from cStringIO import StringIO
90         ftp = te.get_ftp_folder(cr, uid, self, 'Documents')
91         ftp.rmd('Äïêéìáóôéêüò ÖÜêåëëïò/Üëëïò')
92         ftp.rmd('Äïêéìáóôéêüò ÖÜêåëëïò')