[ADD] tests for attachments_to_filesystem
This commit is contained in:
Holger Brunn 2017-05-09 10:19:07 +02:00 committed by Marcel Savegnago
parent f33b68a844
commit 621d5284cd
3 changed files with 6 additions and 3 deletions

View File

@ -37,6 +37,7 @@ def populate_tags(cr, column):
env = Environment(cr, SUPERUSER_ID, {})
document_page_tag = env['document.page.tag']
document_page = env['document.page']
# pylint: disable=E8103
cr.execute(
'SELECT %s, ARRAY_AGG(id) from %s WHERE %s IS NOT NULL GROUP BY %s' % (
column, env['document.page']._table, column, column))

View File

@ -1,3 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
access_document_page_tag,access_document_page_tag,model_document_page_tag,,1,0,0,0
access_document_page_tag_all,access_document_page_tag,model_document_page_tag,,1,0,0,0
access_document_page_tag,access_document_page_tag,model_document_page_tag,base.group_user,1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_document_page_tag access_document_page_tag_all access_document_page_tag model_document_page_tag 1 0 0 0
3 access_document_page_tag access_document_page_tag model_document_page_tag base.group_user 1 1 1 1

View File

@ -20,6 +20,7 @@
from psycopg2 import IntegrityError
from openerp.tests.common import TransactionCase
from ..hooks import post_init_hook
from openerp.tools.misc import mute_logger
class TestDocumentPageTags(TransactionCase):
@ -28,5 +29,6 @@ class TestDocumentPageTags(TransactionCase):
post_init_hook(self.cr, self.registry)
# check we can't create nonunique tags
with self.assertRaises(IntegrityError):
self.env['document.page.tag'].name_create('test')
self.env['document.page.tag'].name_create('test')
with mute_logger('openerp.sql_db'):
self.env['document.page.tag'].name_create('test')
self.env['document.page.tag'].name_create('test')