Commit b39bd2e8 authored by Jérome Perrin's avatar Jérome Perrin

unset filter_content_types for Person and Organisation for this test.

cleanup imports


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12848 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c09625b0
...@@ -26,14 +26,6 @@ ...@@ -26,14 +26,6 @@
# #
############################################################################## ##############################################################################
#
# Skeleton ZopeTestCase
#
from random import randint
import os, sys import os, sys
if __name__ == '__main__': if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py')) execfile(os.path.join(sys.path[0], 'framework.py'))
...@@ -44,9 +36,8 @@ os.environ['EVENT_LOG_SEVERITY'] = '-300' ...@@ -44,9 +36,8 @@ os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager, noSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from zLOG import LOG from zLOG import LOG
import time
try: try:
from transaction import get as get_transaction from transaction import get as get_transaction
...@@ -90,7 +81,6 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -90,7 +81,6 @@ class TestCMFCategory(ERP5TypeTestCase):
return self.getPortal().getId() return self.getPortal().getId()
def test_00_HasEverything(self, quiet=quiet, run=run_all_test): def test_00_HasEverything(self, quiet=quiet, run=run_all_test):
# Test if portal_synchronizations was created
if not run: return if not run: return
if not quiet: if not quiet:
ZopeTestCase._print('\n Test Has Everything ') ZopeTestCase._print('\n Test Has Everything ')
...@@ -102,6 +92,13 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -102,6 +92,13 @@ class TestCMFCategory(ERP5TypeTestCase):
def afterSetUp(self, quiet=1, run=1): def afterSetUp(self, quiet=1, run=1):
self.login() self.login()
portal = self.getPortal() portal = self.getPortal()
# This test creates Person inside Person and Organisation inside
# Organisation, so we modifiy type informations to allow anything inside
# Person and Organisation (we'll cleanup on teardown)
self.getTypesTool().getTypeInfo('Person').filter_content_types = 0
self.getTypesTool().getTypeInfo('Organisation').filter_content_types = 0
# Make persons. # Make persons.
person_module = self.getPersonModule() person_module = self.getPersonModule()
if self.id1 not in person_module.objectIds(): if self.id1 not in person_module.objectIds():
...@@ -172,6 +169,9 @@ class TestCMFCategory(ERP5TypeTestCase): ...@@ -172,6 +169,9 @@ class TestCMFCategory(ERP5TypeTestCase):
for bc in ('region', 'subordination', 'gender'): for bc in ('region', 'subordination', 'gender'):
bc_obj = self.getPortal().portal_categories[bc] bc_obj = self.getPortal().portal_categories[bc]
bc_obj.manage_delObjects() bc_obj.manage_delObjects()
# type informations
self.getTypesTool().getTypeInfo('Person').filter_content_types = 1
self.getTypesTool().getTypeInfo('Organisation').filter_content_types = 1
def login(self, quiet=quiet, run=run_all_test): def login(self, quiet=quiet, run=run_all_test):
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment