summaryrefslogtreecommitdiff
path: root/addons/document_ftp/test
diff options
context:
space:
mode:
Diffstat (limited to 'addons/document_ftp/test')
-rw-r--r--addons/document_ftp/test/document_ftp_test2.yml7
-rw-r--r--addons/document_ftp/test/document_ftp_test4.yml3
2 files changed, 8 insertions, 2 deletions
diff --git a/addons/document_ftp/test/document_ftp_test2.yml b/addons/document_ftp/test/document_ftp_test2.yml
index 872456e7191..33ce1416ec8 100644
--- a/addons/document_ftp/test/document_ftp_test2.yml
+++ b/addons/document_ftp/test/document_ftp_test2.yml
@@ -100,12 +100,13 @@
fdata = StringIO('abcd')
ftp.storbinary('STOR test2.txt', fdata)
ftp.close()
+ cr.commit()
-
I look for the "test2.txt" file at the server
-
!python {model: ir.attachment }: |
ids = self.search(cr, uid, [('name', '=', 'test2.txt')])
- assert ids
+ assert ids, "No test2.txt file found."
-
I delete the "test2.txt" file using FTP.
-
@@ -115,12 +116,13 @@
ftp = te.get_ftp_folder(cr, uid, self, 'Documents')
ftp.delete('test2.txt')
ftp.close()
+ cr.commit()
-
I check at the server that test2.txt is deleted
-
!python {model: ir.attachment }: |
ids = self.search(cr, uid, [('name', '=', 'test2.txt')])
- assert not ids
+ assert not ids, "test2.txt file can still be found."
-
I create a test2.txt file again.
-
@@ -131,6 +133,7 @@
fdata = StringIO('abcd')
ftp.storbinary('STOR test2.txt', fdata)
ftp.close()
+ cr.commit()
-
I delete the test2.txt from the server (RPC).
-
diff --git a/addons/document_ftp/test/document_ftp_test4.yml b/addons/document_ftp/test/document_ftp_test4.yml
index f05fac397bf..0a3ff33333e 100644
--- a/addons/document_ftp/test/document_ftp_test4.yml
+++ b/addons/document_ftp/test/document_ftp_test4.yml
@@ -4,6 +4,7 @@
!python {model: ir.attachment}: |
from document_ftp import test_easyftp as te
ftp = te.get_plain_ftp(timeout=1.0)
+ cr.commit()
- |
I create two partners 'Partner1' and 'Partner2'.
I create three partner categories: 'none', 'pat1' and 'all'
@@ -53,6 +54,7 @@
dirs = ftp.nlst()
for dir in [ 'All Partner1+2', 'No partners', 'Pat 1' ]:
assert dir in dirs, "Dir %s not in folder" % dir
+ cr.commit()
-
I create a 'partners' folder by the first resource one.
-
@@ -79,6 +81,7 @@
for dir in correct:
res = ftp.nlst(dir+'/Partners of Test')
assert res == correct[dir], "Dir %s falsely contains %s" %(dir, res)
+ cr.commit()
-
I create an ir.attachment, attached (not related) to Partner1
-