summaryrefslogtreecommitdiff
path: root/addons/document/test/document_test2.yml
diff options
context:
space:
mode:
authorAtul Patel (OpenERP) <atp@tinyerp.com>2014-02-18 11:26:18 +0530
committerAtul Patel (OpenERP) <atp@tinyerp.com>2014-02-18 11:26:18 +0530
commit33b99c8a0737e08e6a243e41bb455d3ab7e6c851 (patch)
treea1db52bfbeecf0c6fd9096604b7ec4540bb04197 /addons/document/test/document_test2.yml
parentcaa3510ea434e10c32dcbc134f9c74b2b9f18b2a (diff)
parentaa0eac1257b97c1be693e8a804fec6ecbf2bb22f (diff)
[MERGE]: Merged with addons
bzr revid: atp@tinyerp.com-20140218055618-r36w29vat7zig9ar
Diffstat (limited to 'addons/document/test/document_test2.yml')
-rw-r--r--addons/document/test/document_test2.yml17
1 files changed, 17 insertions, 0 deletions
diff --git a/addons/document/test/document_test2.yml b/addons/document/test/document_test2.yml
index beff61d4d0f..0c6345ef6c4 100644
--- a/addons/document/test/document_test2.yml
+++ b/addons/document/test/document_test2.yml
@@ -59,6 +59,23 @@
ids = self.search(cr, uid, [('res_model', '=', 'res.country'), ('res_id', '=', ref("base.za"))])
assert ids == [ ref("attach_3rd")], ids
-
+ I test that I can't create duplicate directories (even when duplicates are hidden by a record rule)
+-
+ !python {model: document.directory}: |
+ duplicate_detected = False
+ from openerp.osv.osv import except_osv
+ try:
+ demo_uid = ref('base.user_demo')
+ dir_vals = {
+ 'name': 'Testing (will be deleted!)',
+ 'parent_id': ref('document.dir_root')
+ }
+ new_dir_id = self.create(cr, demo_uid, dir_vals, context=None)
+ self.unlink(cr, uid, [new_dir_id], context=None)
+ except except_osv, e:
+ duplicate_detected = e.value == u'Directory name must be unique!'
+ assert duplicate_detected is True, 'Failed to detect duplicate directory'
+-
I delete the attachments
-
!python {model: ir.attachment}: |