Commit ba0d6c7b authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: erp5_core_test: Migrate Unit Tests.

parent 65cd196e
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testAudioField</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.tests.testAudioField</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testAudioField</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -33,7 +33,6 @@ from random import randint ...@@ -33,7 +33,6 @@ from random import randint
import sys import sys
import threading import threading
import traceback import traceback
import unittest
import six import six
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
...@@ -101,7 +100,7 @@ class TransactionThread(threading.Thread): ...@@ -101,7 +100,7 @@ class TransactionThread(threading.Thread):
# Login # Login
newSecurityManager(None, portal_value.acl_users.getUser('ERP5TypeTestCase')) newSecurityManager(None, portal_value.acl_users.getUser('ERP5TypeTestCase'))
self.payload(portal_value=portal_value) self.payload(portal_value=portal_value)
except Exception as self.exception: except Exception as self.exception: # pylint: disable=redefine-in-handler
if six.PY2: if six.PY2:
self.exception.__traceback__ = sys.exc_info()[2] self.exception.__traceback__ = sys.exc_info()[2]
...@@ -116,7 +115,7 @@ class TransactionThread(threading.Thread): ...@@ -116,7 +115,7 @@ class TransactionThread(threading.Thread):
self.exception = None self.exception = None
if exception is not None: if exception is not None:
if six.PY3: if six.PY3:
raise exception raise exception # pylint: disable=raising-bad-type
six.reraise(exception, None, exception.__traceback__) six.reraise(exception, None, exception.__traceback__)
def __enter__(self): def __enter__(self):
...@@ -212,8 +211,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -212,8 +211,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
__cleanups = () __cleanups = ()
def _addCleanup(self, callable): def _addCleanup(self, callable_obj):
self.__cleanups += (callable,) self.__cleanups += (callable_obj,)
return callable return callable
def afterSetUp(self): def afterSetUp(self):
...@@ -289,7 +288,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -289,7 +288,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self.assertEqual(len(organisation_module_list),1) self.assertEqual(len(organisation_module_list),1)
def test_03_CreateAndDeleteObject(self): def test_03_CreateAndDeleteObject(self):
portal_catalog = self.getCatalogTool()
person_module = self.getPersonModule() person_module = self.getPersonModule()
person = person_module.newContent(id='1',portal_type='Person') person = person_module.newContent(id='1',portal_type='Person')
address = person.newContent(portal_type='Address') address = person.newContent(portal_type='Address')
...@@ -395,7 +393,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -395,7 +393,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# Now we will try the same thing as previous test and look at searchFolder # Now we will try the same thing as previous test and look at searchFolder
folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()] folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
self.assertEqual([],folder_object_list) self.assertEqual([],folder_object_list)
person = person_module.newContent(id='4',portal_type='Person',) person_module.newContent(id='4',portal_type='Person',)
self.tic() self.tic()
folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()] folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
self.assertEqual(['4'],folder_object_list) self.assertEqual(['4'],folder_object_list)
...@@ -412,7 +410,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -412,7 +410,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()] folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
self.assertEqual([],folder_object_list) self.assertEqual([],folder_object_list)
person = person_module.newContent(id='4',portal_type='Person') person_module.newContent(id='4',portal_type='Person')
self.tic() self.tic()
folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()] folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
self.assertEqual(['4'],folder_object_list) self.assertEqual(['4'],folder_object_list)
...@@ -429,7 +427,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -429,7 +427,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()] folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
self.assertEqual([],folder_object_list) self.assertEqual([],folder_object_list)
person = person_module.newContent(id='4',portal_type='Person') person_module.newContent(id='4',portal_type='Person')
self.tic() self.tic()
folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()] folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
self.assertEqual(['4'],folder_object_list) self.assertEqual(['4'],folder_object_list)
...@@ -441,11 +439,9 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -441,11 +439,9 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
def test_10_OrderedSearchFolder(self): def test_10_OrderedSearchFolder(self):
person_module = self.getPersonModule() person_module = self.getPersonModule()
person_uid_list = [ person_module.newContent(id='a', portal_type='Person', title='a', description='z').getUid()
person_module.newContent(id='a', portal_type='Person', title='a', description='z').getUid(), person_module.newContent(id='b', portal_type='Person', title='a', description='y').getUid()
person_module.newContent(id='b', portal_type='Person', title='a', description='y').getUid(), person_module.newContent(id='c', portal_type='Person', title='a', description='x').getUid()
person_module.newContent(id='c', portal_type='Person', title='a', description='x').getUid(),
]
self.tic() self.tic()
self.assertEqual( self.assertEqual(
['a','b','c'], ['a','b','c'],
...@@ -589,14 +585,13 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -589,14 +585,13 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_catalog = self.getCatalogTool() portal_catalog = self.getCatalogTool()
from Products.ZSQLCatalog.SQLCatalog import UID_BUFFER_SIZE from Products.ZSQLCatalog.SQLCatalog import UID_BUFFER_SIZE
uid_dict = {} uid_dict = {}
for i in xrange(UID_BUFFER_SIZE * 3): for _ in xrange(UID_BUFFER_SIZE * 3):
uid = portal_catalog.newUid() uid = portal_catalog.newUid()
self.assertTrue(isinstance(uid, long)) self.assertTrue(isinstance(uid, long))
self.assertFalse(uid in uid_dict) self.assertFalse(uid in uid_dict)
uid_dict[uid] = None uid_dict[uid] = None
def test_17_CreationDate_ModificationDate(self): def test_17_CreationDate_ModificationDate(self):
portal_catalog = self.getCatalogTool()
portal = self.getPortal() portal = self.getPortal()
sql_connection = self.getSQLConnection() sql_connection = self.getSQLConnection()
...@@ -637,7 +632,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -637,7 +632,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
person_module = self.getPersonModule() person_module = self.getPersonModule()
title = 'Sébastien' title = 'Sébastien'
person = person_module.newContent(id='5',portal_type='Person',title=title) person_module.newContent(id='5',portal_type='Person',title=title)
self.tic() self.tic()
folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()] folder_object_list = [x.getObject().getId() for x in person_module.searchFolder()]
self.assertEqual(['5'],folder_object_list) self.assertEqual(['5'],folder_object_list)
...@@ -649,7 +644,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -649,7 +644,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
person_module = self.getPersonModule() person_module = self.getPersonModule()
title = 'Sébastien' title = 'Sébastien'
person = person_module.newContent(id='5',portal_type='Person', title=title) person_module.newContent(id='5',portal_type='Person', title=title)
self.tic() self.tic()
folder_object_list = [x.getObject().getId() for x in folder_object_list = [x.getObject().getId() for x in
person_module.searchFolder(title=title)] person_module.searchFolder(title=title)]
...@@ -785,7 +780,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -785,7 +780,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal = self.getPortal() portal = self.getPortal()
portal.manage_delObjects('erp5_sql_connection') portal.manage_delObjects('erp5_sql_connection')
# Then it must be impossible to delete an object # Then it must be impossible to delete an object
uid = person.getUid()
unindex = portal_catalog.unindexObject unindex = portal_catalog.unindexObject
self.assertRaises(AttributeError,unindex,person,uid=person.getUid()) self.assertRaises(AttributeError,unindex,person,uid=person.getUid())
self.abort() self.abort()
...@@ -864,8 +858,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -864,8 +858,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
organisation = portal.organisation_module.\ organisation = portal.organisation_module.\
newContent(portal_type="Organisation") newContent(portal_type="Organisation")
person_module = portal.person_module person_module = portal.person_module
person_1 = person_module.newContent(portal_type="Person") person_module.newContent(portal_type="Person")
person_2 = person_module.newContent(portal_type="Person", person_module.newContent(portal_type="Person",
career_subordination_value=organisation) career_subordination_value=organisation)
self.tic() self.tic()
self.assertEqual(len(person_module.searchFolder()), self.assertEqual(len(person_module.searchFolder()),
...@@ -875,7 +869,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -875,7 +869,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
"""Check that sorting on a related key that does not support left join. """Check that sorting on a related key that does not support left join.
""" """
portal = self.getPortalObject() portal = self.getPortalObject()
org_a = self._makeOrganisation(title='abc', default_address_city='abc') self._makeOrganisation(title='abc', default_address_city='abc')
# now turn the z_related_grand_parent into an old-style method, without # now turn the z_related_grand_parent into an old-style method, without
# RELATED_QUERY_SEPARATOR # RELATED_QUERY_SEPARATOR
...@@ -883,7 +877,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -883,7 +877,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
old_src = method.src old_src = method.src
@self._addCleanup @self._addCleanup
def cleanGrandParentMethod(self): def cleanGrandParentMethod(self): # pylint: disable=unused-variable
method.manage_edit(method.title, method.connection_id, method.manage_edit(method.title, method.connection_id,
method.arguments_src, old_src) method.arguments_src, old_src)
...@@ -891,8 +885,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -891,8 +885,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
method.manage_edit(method.title, method.connection_id, method.arguments_src, method.manage_edit(method.title, method.connection_id, method.arguments_src,
src) src)
query = dict(grand_parent_portal_type="Organisation Module",
parent_reference=org_a.getReference())
self.tic() self.tic()
self.assertNotEquals(0, len(portal.portal_catalog( self.assertNotEquals(0, len(portal.portal_catalog(
portal_type='Address', portal_type='Address',
...@@ -960,8 +952,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -960,8 +952,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
"""use a dict as a keyword parameter, with max range parameter ( < ) """use a dict as a keyword parameter, with max range parameter ( < )
""" """
org_a = self._makeOrganisation(title='A') org_a = self._makeOrganisation(title='A')
org_b = self._makeOrganisation(title='B') self._makeOrganisation(title='B')
org_c = self._makeOrganisation(title='C') self._makeOrganisation(title='C')
self.assertEqual([org_a.getPath()], self.assertEqual([org_a.getPath()],
[x.path for x in self.getCatalogTool()( [x.path for x in self.getCatalogTool()(
...@@ -971,7 +963,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -971,7 +963,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
def test_35_SimpleQueryDictWithMinRangeParameter(self): def test_35_SimpleQueryDictWithMinRangeParameter(self):
"""use a dict as a keyword parameter, with min range parameter ( >= ) """use a dict as a keyword parameter, with min range parameter ( >= )
""" """
org_a = self._makeOrganisation(title='A') self._makeOrganisation(title='A')
org_b = self._makeOrganisation(title='B') org_b = self._makeOrganisation(title='B')
org_c = self._makeOrganisation(title='C') org_c = self._makeOrganisation(title='C')
...@@ -986,7 +978,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -986,7 +978,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
""" """
org_a = self._makeOrganisation(title='A') org_a = self._makeOrganisation(title='A')
org_b = self._makeOrganisation(title='B') org_b = self._makeOrganisation(title='B')
org_c = self._makeOrganisation(title='C') self._makeOrganisation(title='C')
self.failIfDifferentSet([org_a.getPath(), org_b.getPath()], self.failIfDifferentSet([org_a.getPath(), org_b.getPath()],
[x.path for x in self.getCatalogTool()( [x.path for x in self.getCatalogTool()(
...@@ -996,9 +988,9 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -996,9 +988,9 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
def test_37_SimpleQueryDictWithMinMaxRangeParameter(self): def test_37_SimpleQueryDictWithMinMaxRangeParameter(self):
"""use a dict as a keyword parameter, with minmax range parameter ( >= < ) """use a dict as a keyword parameter, with minmax range parameter ( >= < )
""" """
org_a = self._makeOrganisation(title='A') self._makeOrganisation(title='A')
org_b = self._makeOrganisation(title='B') org_b = self._makeOrganisation(title='B')
org_c = self._makeOrganisation(title='C') self._makeOrganisation(title='C')
self.assertEqual([org_b.getPath()], self.assertEqual([org_b.getPath()],
[x.path for x in self.getCatalogTool()( [x.path for x in self.getCatalogTool()(
...@@ -1008,7 +1000,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1008,7 +1000,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
def test_38_SimpleQueryDictWithMinNgtRangeParameter(self): def test_38_SimpleQueryDictWithMinNgtRangeParameter(self):
"""use a dict as a keyword parameter, with minngt range parameter ( >= <= ) """use a dict as a keyword parameter, with minngt range parameter ( >= <= )
""" """
org_a = self._makeOrganisation(title='A') self._makeOrganisation(title='A')
org_b = self._makeOrganisation(title='B') org_b = self._makeOrganisation(title='B')
org_c = self._makeOrganisation(title='C') org_c = self._makeOrganisation(title='C')
...@@ -1020,7 +1012,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1020,7 +1012,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
def test_QueryDictFromRequest(self): def test_QueryDictFromRequest(self):
"""use a dict from REQUEST as a keyword parameter. """use a dict from REQUEST as a keyword parameter.
""" """
org_a = self._makeOrganisation(title='A') self._makeOrganisation(title='A')
org_b = self._makeOrganisation(title='B') org_b = self._makeOrganisation(title='B')
org_c = self._makeOrganisation(title='C') org_c = self._makeOrganisation(title='C')
...@@ -1118,7 +1110,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1118,7 +1110,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self.assertTrue('this' in ob.SearchableText(), ob.SearchableText()) self.assertTrue('this' in ob.SearchableText(), ob.SearchableText())
# add some other objects, we need to create a minimum quantity of data for # add some other objects, we need to create a minimum quantity of data for
# full text queries to work correctly # full text queries to work correctly
for i in range(10): for _ in range(10):
otherob = folder.newContent() otherob = folder.newContent()
otherob.setTitle('Something different') otherob.setTitle('Something different')
self.assertFalse('this' in otherob.SearchableText(), otherob.SearchableText()) self.assertFalse('this' in otherob.SearchableText(), otherob.SearchableText())
...@@ -1148,7 +1140,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1148,7 +1140,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_type='Organisation', SearchableText='different')[0][0]) portal_type='Organisation', SearchableText='different')[0][0])
def test_43_ManagePasteObject(self): def test_43_ManagePasteObject(self):
portal_catalog = self.getCatalogTool()
person_module = self.getPersonModule() person_module = self.getPersonModule()
person = person_module.newContent(id='1',portal_type='Person') person = person_module.newContent(id='1',portal_type='Person')
self.tic() self.tic()
...@@ -1160,7 +1151,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1160,7 +1151,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self.checkRelativeUrlInSQLPathList(path_list) self.checkRelativeUrlInSQLPathList(path_list)
def test_44_ParentRelatedKeys(self): def test_44_ParentRelatedKeys(self):
portal_catalog = self.getCatalogTool()
person_module = self.getPersonModule() person_module = self.getPersonModule()
person_module.reindexObject() person_module.reindexObject()
person = person_module.newContent(id='1',portal_type='Person') person = person_module.newContent(id='1',portal_type='Person')
...@@ -1346,8 +1336,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1346,8 +1336,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
for destination_sql_connection_id, source_sql_connection_id in \ for destination_sql_connection_id, source_sql_connection_id in \
zip(destination_sql_connection_id_list, zip(destination_sql_connection_id_list,
source_sql_connection_id_list): source_sql_connection_id_list):
if source_sql_connection_id != destination_sql_connection_id: if source_sql_connection_id != destination_sql_connection_id:
sql_connection_id_dict[destination_sql_connection_id] = \ sql_connection_id_dict[destination_sql_connection_id] = \
source_sql_connection_id source_sql_connection_id
portal_catalog.changeSQLConnectionIds( portal_catalog.changeSQLConnectionIds(
folder=portal.portal_skins, folder=portal.portal_skins,
...@@ -1504,7 +1494,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1504,7 +1494,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
cases to decrease a lot the number of aliases cases to decrease a lot the number of aliases
""" """
org_a = self._makeOrganisation(title='abc',default_address_city='abc') org_a = self._makeOrganisation(title='abc',default_address_city='abc')
module = self.getOrganisationModule()
self.tic() self.tic()
# First try without aliases # First try without aliases
query1 = Query(parent_portal_type="Organisation") query1 = Query(parent_portal_type="Organisation")
...@@ -1540,7 +1529,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1540,7 +1529,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
sql = "UPDATE catalog SET modification_date='%s' '\ sql = "UPDATE catalog SET modification_date='%s' '\
'WHERE uid=%s" %\ 'WHERE uid=%s" %\
(date,uid) (date,uid)
result = sql_connection.manage_test(sql) sql_connection.manage_test(sql)
updateDate(org_a,'2007-01-12 01:02:03') updateDate(org_a,'2007-01-12 01:02:03')
updateDate(org_b,'2006-02-24 15:09:06') updateDate(org_b,'2006-02-24 15:09:06')
...@@ -1583,7 +1572,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1583,7 +1572,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
portal_type='Organisation',**catalog_kw)]) portal_type='Organisation',**catalog_kw)])
def test_54_FixIntUid(self): def test_54_FixIntUid(self):
portal_catalog = self.getCatalogTool()
portal = self.getPortal() portal = self.getPortal()
module = portal.getDefaultModule('Organisation') module = portal.getDefaultModule('Organisation')
...@@ -1621,7 +1609,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1621,7 +1609,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# Add a script to create uid list # Add a script to create uid list
catalog = self.getCatalogTool().getSQLCatalog() catalog = self.getCatalogTool().getSQLCatalog()
script_id = 'z0_zCreateUid' script_id = 'z0_zCreateUid'
script = createZODBPythonScript( createZODBPythonScript(
catalog, catalog,
script_id, script_id,
'*args,**kw', '*args,**kw',
...@@ -1752,7 +1740,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1752,7 +1740,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
perm = 'View' perm = 'View'
folder = self.getOrganisationModule() folder = self.getOrganisationModule()
portal_type = 'Organisation'
sub_portal_type_id = 'Address' sub_portal_type_id = 'Address'
sub_portal_type = self.getPortal().portal_types._getOb(sub_portal_type_id) sub_portal_type = self.getPortal().portal_types._getOb(sub_portal_type_id)
...@@ -2106,8 +2093,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -2106,8 +2093,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
for acquire_view_permission in (True, False): for acquire_view_permission in (True, False):
for view_role_list in (['Owner', 'Author'], for view_role_list in (['Owner', 'Author'],
['Author']): ['Author']):
object = object_dict[getObjectDictKey()] obj = object_dict[getObjectDictKey()]
result = query('SELECT roles_and_users.uid FROM roles_and_users, catalog WHERE roles_and_users.uid = catalog.security_uid AND catalog.uid = %i AND allowedRolesAndUsers = "user:bar:Whatever"' % (object.uid, )) result = query('SELECT roles_and_users.uid FROM roles_and_users, catalog WHERE roles_and_users.uid = catalog.security_uid AND catalog.uid = %i AND allowedRolesAndUsers = "user:bar:Whatever"' % (obj.uid, ))
self.assertEqual(len(result), 0, '%r: len(%r) != 0' % (getObjectDictKey(), result)) self.assertEqual(len(result), 0, '%r: len(%r) != 0' % (getObjectDictKey(), result))
# Check that no 'bar' role are in security table when 'foo' has local # Check that no 'bar' role are in security table when 'foo' has local
...@@ -2119,12 +2106,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -2119,12 +2106,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
for acquire_view_permission in (True, False): for acquire_view_permission in (True, False):
for view_role_list in (['Owner', 'Author'], for view_role_list in (['Owner', 'Author'],
['Author']): ['Author']):
object = object_dict[getObjectDictKey()] obj = object_dict[getObjectDictKey()]
result = query('SELECT roles_and_users.uid, roles_and_users.allowedRolesAndUsers FROM roles_and_users, catalog WHERE roles_and_users.uid = catalog.security_uid AND catalog.uid = %i AND roles_and_users.allowedRolesAndUsers LIKE "user:bar%%"' % (object.uid, )) result = query('SELECT roles_and_users.uid, roles_and_users.allowedRolesAndUsers FROM roles_and_users, catalog WHERE roles_and_users.uid = catalog.security_uid AND catalog.uid = %i AND roles_and_users.allowedRolesAndUsers LIKE "user:bar%%"' % (obj.uid, ))
self.assertEqual(len(result), 0, '%r: len(%r) != 0' % (getObjectDictKey(), result)) self.assertEqual(len(result), 0, '%r: len(%r) != 0' % (getObjectDictKey(), result))
def test_RealOwnerIndexing(self): def test_RealOwnerIndexing(self):
logout = self.logout
user1 = 'local_foo' user1 = 'local_foo'
user2 = 'local_bar' user2 = 'local_bar'
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
...@@ -2137,8 +2123,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -2137,8 +2123,6 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
folder.manage_setLocalRoles(user2, ['Author', 'Auditor']) folder.manage_setLocalRoles(user2, ['Author', 'Auditor'])
portal_type = 'Organisation' portal_type = 'Organisation'
sql_connection = self.getSQLConnection()
self.loginByUserName(user2) self.loginByUserName(user2)
obj2 = folder.newContent(portal_type=portal_type) obj2 = folder.newContent(portal_type=portal_type)
obj2.manage_setLocalRoles(user1, ['Auditor']) obj2.manage_setLocalRoles(user1, ['Auditor'])
...@@ -2273,7 +2257,6 @@ VALUES ...@@ -2273,7 +2257,6 @@ VALUES
self.tic() self.tic()
result = obj.portal_catalog(portal_type=portal_type) result = obj.portal_catalog(portal_type=portal_type)
self.assertSameSet([obj2, ], [x.getObject() for x in result]) self.assertSameSet([obj2, ], [x.getObject() for x in result])
method = obj.portal_catalog
result = obj.portal_catalog(portal_type=portal_type, local_roles='Owner') result = obj.portal_catalog(portal_type=portal_type, local_roles='Owner')
self.assertSameSet([], [x.getObject() for x in result]) self.assertSameSet([], [x.getObject() for x in result])
result = obj.portal_catalog(portal_type=portal_type, local_roles='Auditor') result = obj.portal_catalog(portal_type=portal_type, local_roles='Auditor')
...@@ -2311,7 +2294,6 @@ VALUES ...@@ -2311,7 +2294,6 @@ VALUES
self.commit() self.commit()
def test_MonoValueAssigneeIndexing(self): def test_MonoValueAssigneeIndexing(self):
logout = self.logout
user1 = 'local_foo' user1 = 'local_foo'
user2 = 'local_bar' user2 = 'local_bar'
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
...@@ -2324,7 +2306,6 @@ VALUES ...@@ -2324,7 +2306,6 @@ VALUES
folder.manage_setLocalRoles(user2, ['Author', 'Auditor']) folder.manage_setLocalRoles(user2, ['Author', 'Auditor'])
portal_type = 'Organisation' portal_type = 'Organisation'
sql_connection = self.getSQLConnection()
self.loginByUserName(user2) self.loginByUserName(user2)
obj2 = folder.newContent(portal_type=portal_type) obj2 = folder.newContent(portal_type=portal_type)
...@@ -2480,7 +2461,6 @@ VALUES ...@@ -2480,7 +2461,6 @@ VALUES
self.tic() self.tic()
result = obj.portal_catalog(portal_type=portal_type) result = obj.portal_catalog(portal_type=portal_type)
self.assertSameSet([obj2, ], [x.getObject() for x in result]) self.assertSameSet([obj2, ], [x.getObject() for x in result])
method = obj.portal_catalog
result = obj.portal_catalog(portal_type=portal_type, local_roles='Assignee') result = obj.portal_catalog(portal_type=portal_type, local_roles='Assignee')
self.assertSameSet([], [x.getObject() for x in result]) self.assertSameSet([], [x.getObject() for x in result])
result = obj.portal_catalog(portal_type=portal_type, local_roles='Auditor') result = obj.portal_catalog(portal_type=portal_type, local_roles='Auditor')
...@@ -2521,13 +2501,12 @@ VALUES ...@@ -2521,13 +2501,12 @@ VALUES
self.commit() self.commit()
def test_UserOrGroupRoleIndexing(self): def test_UserOrGroupRoleIndexing(self):
logout = self.logout
user1 = 'a_great_user_name' user1 = 'a_great_user_name'
user1_group = 'a_great_user_group' user1_group = 'a_great_user_group'
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
uf._doAddUser(user1, user1, ['Member', ], []) uf._doAddUser(user1, user1, ['Member', ], [])
uf.zodb_groups.addGroup( user1_group, user1_group, user1_group) uf.zodb_groups.addGroup( user1_group, user1_group, user1_group)
new = uf.zodb_groups.addPrincipalToGroup( user1, user1_group ) uf.zodb_groups.addPrincipalToGroup( user1, user1_group )
perm = 'View' perm = 'View'
folder = self.getOrganisationModule() folder = self.getOrganisationModule()
...@@ -2638,7 +2617,6 @@ VALUES ...@@ -2638,7 +2617,6 @@ VALUES
sql_catalog.sql_search_tables = sql_catalog.sql_search_tables + \ sql_catalog.sql_search_tables = sql_catalog.sql_search_tables + \
[local_roles_table] [local_roles_table]
portal = self.getPortal()
self.commit() self.commit()
try: try:
...@@ -2789,13 +2767,12 @@ VALUES ...@@ -2789,13 +2767,12 @@ VALUES
self.commit() self.commit()
def test_UserOrGroupLocalRoleIndexing(self): def test_UserOrGroupLocalRoleIndexing(self):
logout = self.logout
user1 = 'another_great_user_name' user1 = 'another_great_user_name'
user1_group = 'another_great_user_group' user1_group = 'another_great_user_group'
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
uf._doAddUser(user1, user1, ['Member', ], []) uf._doAddUser(user1, user1, ['Member', ], [])
uf.zodb_groups.addGroup( user1_group, user1_group, user1_group) uf.zodb_groups.addGroup( user1_group, user1_group, user1_group)
new = uf.zodb_groups.addPrincipalToGroup( user1, user1_group ) uf.zodb_groups.addPrincipalToGroup( user1, user1_group )
perm = 'View' perm = 'View'
folder = self.getOrganisationModule() folder = self.getOrganisationModule()
...@@ -2897,7 +2874,6 @@ VALUES ...@@ -2897,7 +2874,6 @@ VALUES
sql_catalog.sql_search_tables = sql_catalog.sql_search_tables + \ sql_catalog.sql_search_tables = sql_catalog.sql_search_tables + \
[local_roles_table] [local_roles_table]
portal = self.getPortal()
self.commit() self.commit()
try: try:
...@@ -3125,7 +3101,6 @@ VALUES ...@@ -3125,7 +3101,6 @@ VALUES
sql_catalog.sql_search_tables = sql_catalog.sql_search_tables + \ sql_catalog.sql_search_tables = sql_catalog.sql_search_tables + \
[local_roles_table] [local_roles_table]
portal = self.getPortal()
self.commit() self.commit()
try: try:
...@@ -3179,7 +3154,7 @@ VALUES ...@@ -3179,7 +3154,7 @@ VALUES
ZopeTestCase._print('\n Skipping test_ObjectReindexatoinConcurency (portal_activities not found)') ZopeTestCase._print('\n Skipping test_ObjectReindexatoinConcurency (portal_activities not found)')
return return
container = organisation_module = portal.organisation_module container = portal.organisation_module
document_1 = container.newContent() document_1 = container.newContent()
document_1_1 = document_1.newContent() document_1_1 = document_1.newContent()
document_1_2 = document_1.newContent() document_1_2 = document_1.newContent()
...@@ -3345,8 +3320,8 @@ VALUES ...@@ -3345,8 +3320,8 @@ VALUES
""" """
portal_type = 'Organisation' portal_type = 'Organisation'
folder = self.getOrganisationModule() folder = self.getOrganisationModule()
first_doc = folder.newContent(portal_type=portal_type, reference="doc 1") folder.newContent(portal_type=portal_type, reference="doc 1")
second_doc = folder.newContent(portal_type=portal_type, reference="doc 2", description="test") folder.newContent(portal_type=portal_type, reference="doc 2", description="test")
self.tic() self.tic()
result = folder.portal_catalog(portal_type=portal_type, reference='doc %', description='%') result = folder.portal_catalog(portal_type=portal_type, reference='doc %', description='%')
self.assertEqual(len(result), 2) self.assertEqual(len(result), 2)
...@@ -3365,7 +3340,7 @@ VALUES ...@@ -3365,7 +3340,7 @@ VALUES
portal = self.portal portal = self.portal
def _create(**kw): def _create(**kw):
return portal.organisation_module.newContent(portal_type='Organisation', **kw) return portal.organisation_module.newContent(portal_type='Organisation', **kw)
def create(id, related_obect_list): def create(id, related_obect_list): # pylint: disable=redefined-builtin
return _create(id=id, return _create(id=id,
site_value_list=related_obect_list, site_value_list=related_obect_list,
function_value_list=related_obect_list) function_value_list=related_obect_list)
...@@ -3383,7 +3358,7 @@ VALUES ...@@ -3383,7 +3358,7 @@ VALUES
object_1 = create('object_1', [related_1]) object_1 = create('object_1', [related_1])
object_2 = create('object_2', [related_2]) object_2 = create('object_2', [related_2])
object_3 = create('object_3', [related_3]) object_3 = create('object_3', [related_3])
object_4 = create('object_4', [related_4]) create('object_4', [related_4])
object_12 = create('object_12', [related_1, related_2]) object_12 = create('object_12', [related_1, related_2])
object_13 = create('object_13', [related_1, related_3]) object_13 = create('object_13', [related_1, related_3])
object_14 = create('object_14', [related_1, related_4]) object_14 = create('object_14', [related_1, related_4])
...@@ -3891,7 +3866,7 @@ VALUES ...@@ -3891,7 +3866,7 @@ VALUES
old_src = method.src old_src = method.src
@self._addCleanup @self._addCleanup
def cleanGrandParentMethod(self): def cleanGrandParentMethod(self): # pylint: disable=unused-variable
method.manage_edit(method.title, method.connection_id, method.manage_edit(method.title, method.connection_id,
method.arguments_src, old_src) method.arguments_src, old_src)
...@@ -3942,26 +3917,26 @@ VALUES ...@@ -3942,26 +3917,26 @@ VALUES
self.portal.portal_activities.__class__.doSomething = doSomething self.portal.portal_activities.__class__.doSomething = doSomething
now = DateTime() now = DateTime()
try: try:
organisation_list = [] organisation_list = []
for x in xrange(0,300): for _ in xrange(0,300):
organisation_list.append( organisation_list.append(
self.portal.organisation_module.newContent().getPath()) self.portal.organisation_module.newContent().getPath())
self.tic() self.tic()
self.portal.portal_catalog.searchAndActivate( self.portal.portal_catalog.searchAndActivate(
creation_date={'query': now, 'range': 'min'}, creation_date={'query': now, 'range': 'min'},
method_id="dummyDoSomething", method_id="dummyDoSomething",
group_kw = {"group_method_id" : "portal_activities/doSomething", group_kw = {"group_method_id" : "portal_activities/doSomething",
"group_method_cost": 0.5}, "group_method_cost": 0.5},
) )
self.tic() self.tic()
self.assertEqual(150, len(group_method_call_list)) self.assertEqual(150, len(group_method_call_list))
organisation_call_list = [] organisation_call_list = []
for call_path_list in group_method_call_list: for call_path_list in group_method_call_list:
self.assertEqual(2, len(call_path_list)) self.assertEqual(2, len(call_path_list))
organisation_call_list.extend(call_path_list) organisation_call_list.extend(call_path_list)
organisation_call_list.sort() organisation_call_list.sort()
organisation_list.sort() organisation_list.sort()
self.assertEqual(organisation_call_list, organisation_list) self.assertEqual(organisation_call_list, organisation_list)
finally: finally:
del self.portal.portal_activities.__class__.doSomething del self.portal.portal_activities.__class__.doSomething
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testERP5Catalog</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Catalog.tests.testERP5Catalog</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testERP5Catalog</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -66,16 +66,16 @@ class TestFieldValueCache(ERP5TypeTestCase): ...@@ -66,16 +66,16 @@ class TestFieldValueCache(ERP5TypeTestCase):
form() form()
# Get form value # Get form value
field = form.my_first_name field = form.my_first_name
id = 'title' id_ = 'title'
from Products.ERP5Form.Form import field_value_cache from Products.ERP5Form.Form import field_value_cache
cache_id = ('ProxyField.get_value', cache_id = ('ProxyField.get_value',
field._p_oid, field._p_oid,
field._p_oid, field._p_oid,
id) id_)
# Make sure cache has field # Make sure cache has field
self.assertTrue(field_value_cache.has_key(cache_id)) self.assertTrue(field_value_cache.has_key(cache_id))
# Make sure cache and field are equal # Make sure cache and field are equal
self.assertEqual(field.get_value(id), field_value_cache[cache_id]) self.assertEqual(field.get_value(id_), field_value_cache[cache_id])
# Call manage_renameObject # Call manage_renameObject
form.manage_renameObject('my_first_name', 'my_first_name2') form.manage_renameObject('my_first_name', 'my_first_name2')
form.manage_renameObject('my_first_name2', 'my_first_name') form.manage_renameObject('my_first_name2', 'my_first_name')
...@@ -86,4 +86,4 @@ class TestFieldValueCache(ERP5TypeTestCase): ...@@ -86,4 +86,4 @@ class TestFieldValueCache(ERP5TypeTestCase):
# Make sure cache has field # Make sure cache has field
self.assertTrue(field_value_cache.has_key(cache_id)) self.assertTrue(field_value_cache.has_key(cache_id))
# Make sure cache and field are equal # Make sure cache and field are equal
self.assertEqual(field.get_value(id), field_value_cache[cache_id]) self.assertEqual(field.get_value(id_), field_value_cache[cache_id])
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testFieldValueCache</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.tests.testFieldValueCache</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testFieldValueCache</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -34,13 +34,12 @@ import unittest ...@@ -34,13 +34,12 @@ import unittest
# Initialize ERP5Form Product to load monkey patches # Initialize ERP5Form Product to load monkey patches
from Acquisition import aq_base
from Products.Formulator.FieldRegistry import FieldRegistry from Products.Formulator.FieldRegistry import FieldRegistry
from Products.Formulator.Validator import ValidationError from Products.Formulator.Validator import ValidationError
from Products.Formulator.StandardFields import FloatField, StringField,\ from Products.Formulator.StandardFields import FloatField, StringField,\
DateTimeField, TextAreaField, CheckBoxField, ListField, LinesField, \ DateTimeField, TextAreaField, CheckBoxField, ListField, LinesField, \
MultiListField, IntegerField MultiListField, IntegerField
from Products.Formulator.MethodField import Method, BoundMethod from Products.Formulator.MethodField import Method
from Products.Formulator.TALESField import TALESMethod from Products.Formulator.TALESField import TALESMethod
from Products.ERP5Type.Core.Folder import Folder from Products.ERP5Type.Core.Folder import Folder
...@@ -61,7 +60,7 @@ class TestRenderViewAPI(ERP5TypeTestCase): ...@@ -61,7 +60,7 @@ class TestRenderViewAPI(ERP5TypeTestCase):
return "{Field,Widget}.render_view" return "{Field,Widget}.render_view"
def test_signature(self): def test_signature(self):
for field in FieldRegistry.get_field_classes().itervalues(): for field in FieldRegistry.get_field_classes().itervalues(): # pylint: disable=no-value-for-parameter
self.assertEqual(('self', 'value', 'REQUEST', 'render_prefix'), self.assertEqual(('self', 'value', 'REQUEST', 'render_prefix'),
field.render_view.im_func.func_code.co_varnames) field.render_view.im_func.func_code.co_varnames)
if field is not ProxyField.ProxyField: if field is not ProxyField.ProxyField:
...@@ -643,9 +642,9 @@ class TestProxyField(ERP5TypeTestCase): ...@@ -643,9 +642,9 @@ class TestProxyField(ERP5TypeTestCase):
_setUpDefaultTraversable() _setUpDefaultTraversable()
def addField(self, form, id, title, field_type): def addField(self, form, id_, title, field_type):
form.manage_addField(id, title, field_type) form.manage_addField(id_, title, field_type)
field = getattr(form, id) field = getattr(form, id_)
field._p_oid = makeDummyOid() field._p_oid = makeDummyOid()
return field return field
...@@ -692,8 +691,8 @@ class TestProxyField(ERP5TypeTestCase): ...@@ -692,8 +691,8 @@ class TestProxyField(ERP5TypeTestCase):
def test_get_value_default(self): def test_get_value_default(self):
# If the proxy field is named 'my_id', it will get 'id' # If the proxy field is named 'my_id', it will get 'id'
# property on the context, regardless of the id of the proxified field # property on the context, regardless of the id of the proxified field
original_field = self.addField(self.container.Base_viewProxyFieldLibrary, self.addField(self.container.Base_viewProxyFieldLibrary,
'my_title', 'Title', 'StringField') 'my_title', 'Title', 'StringField')
proxy_field = self.addField(self.container.Base_view, proxy_field = self.addField(self.container.Base_view,
'my_id', 'ID', 'ProxyField') 'my_id', 'ID', 'ProxyField')
proxy_field.manage_edit_xmlrpc(dict(form_id='Base_viewProxyFieldLibrary', proxy_field.manage_edit_xmlrpc(dict(form_id='Base_viewProxyFieldLibrary',
...@@ -789,8 +788,8 @@ class TestProxyField(ERP5TypeTestCase): ...@@ -789,8 +788,8 @@ class TestProxyField(ERP5TypeTestCase):
def test_manage_edit_surcharged_xmlrpc(self): def test_manage_edit_surcharged_xmlrpc(self):
# manage_edit_surcharged_xmlrpc is a method to edit proxyfields # manage_edit_surcharged_xmlrpc is a method to edit proxyfields
# programmatically # programmatically
original_field = self.addField(self.container.Base_viewProxyFieldLibrary, self.addField(self.container.Base_viewProxyFieldLibrary,
'my_string', 'String', 'StringField') 'my_string', 'String', 'StringField')
proxy_field = self.addField(self.container.Base_view, proxy_field = self.addField(self.container.Base_view,
'my_String', '', 'ProxyField') 'my_String', '', 'ProxyField')
proxy_field.manage_edit_xmlrpc(dict(form_id='Base_viewProxyFieldLibrary', proxy_field.manage_edit_xmlrpc(dict(form_id='Base_viewProxyFieldLibrary',
...@@ -809,8 +808,8 @@ class TestProxyField(ERP5TypeTestCase): ...@@ -809,8 +808,8 @@ class TestProxyField(ERP5TypeTestCase):
""" """
Test a case that if proxy field id is same as template field id. Test a case that if proxy field id is same as template field id.
""" """
original_field = self.addField(self.container.Base_viewProxyFieldLibrary, self.addField(self.container.Base_viewProxyFieldLibrary,
'my_string', 'String', 'StringField') 'my_string', 'String', 'StringField')
# Use different id to the template field. # Use different id to the template field.
proxy_field2 = self.addField(self.container.Base_view, proxy_field2 = self.addField(self.container.Base_view,
'my_another_string', '', 'ProxyField') 'my_another_string', '', 'ProxyField')
...@@ -842,8 +841,8 @@ class TestProxyField(ERP5TypeTestCase): ...@@ -842,8 +841,8 @@ class TestProxyField(ERP5TypeTestCase):
not surcharged. not surcharged.
""" """
# create a field # create a field
original_field = self.addField(self.container.Base_viewProxyFieldLibrary, self.addField(self.container.Base_viewProxyFieldLibrary,
'my_title', 'OrigTitle', 'StringField') 'my_title', 'OrigTitle', 'StringField')
field = self.addField(self.container.Base_view, field = self.addField(self.container.Base_view,
'my_dict_test', '', 'ProxyField') 'my_dict_test', '', 'ProxyField')
field.manage_edit_xmlrpc(dict(form_id='Base_viewProxyFieldLibrary', field.manage_edit_xmlrpc(dict(form_id='Base_viewProxyFieldLibrary',
...@@ -961,9 +960,9 @@ class TestFieldValueCache(ERP5TypeTestCase): ...@@ -961,9 +960,9 @@ class TestFieldValueCache(ERP5TypeTestCase):
def test_method_field(self): def test_method_field(self):
field = self.root.form.field field = self.root.form.field
value, cacheable = getFieldValue(field, field, 'external_validator') value, _ = getFieldValue(field, field, 'external_validator')
self.assertEqual(False, value.value is field.values['external_validator']) self.assertEqual(False, value.value is field.values['external_validator'])
self.assertEqual(True, type(value.value) is Method) self.assertEqual(True, isinstance(value.value, Method))
def _getCacheSize(self, cache_id): def _getCacheSize(self, cache_id):
count = 0 count = 0
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testFields</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.tests.testFields</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testFields</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -33,7 +33,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase ...@@ -33,7 +33,6 @@ from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
import unittest import unittest
from Products.Formulator.Validator import ValidationError from Products.Formulator.Validator import ValidationError
from Products.ERP5Form import HoneypotField from Products.ERP5Form import HoneypotField
from Products.Formulator.StandardFields import FloatField
class TestHoneypotField(ERP5TypeTestCase): class TestHoneypotField(ERP5TypeTestCase):
"""Tests Honeypot field """Tests Honeypot field
...@@ -57,10 +56,10 @@ class TestHoneypotField(ERP5TypeTestCase): ...@@ -57,10 +56,10 @@ class TestHoneypotField(ERP5TypeTestCase):
self.assertRaises(ValidationError, self.assertRaises(ValidationError,
self.validator.validate, self.field, 'field_test_field', self.validator.validate, self.field, 'field_test_field',
self.portal.REQUEST) self.portal.REQUEST)
def test_ok_when_empty_value_submit(self): def test_ok_when_empty_value_submit(self):
self.portal.REQUEST.set('field_test_field', '') self.portal.REQUEST.set('field_test_field', '')
self.assertEqual('', self.validator.validate(self.field, 'field_test_field', self.assertEqual('', self.validator.validate(self.field, 'field_test_field',
self.portal.REQUEST)) self.portal.REQUEST))
def test_suite(): def test_suite():
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testHoneypotField</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.tests.testHoneypotField</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testHoneypotField</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -53,7 +53,7 @@ class TestPredicateMixIn(ERP5TypeTestCase): ...@@ -53,7 +53,7 @@ class TestPredicateMixIn(ERP5TypeTestCase):
def getTitle(self): def getTitle(self):
return "Predicates" return "Predicates"
def login(self) : def login(self, *args, **kw) :
"""sets the security manager""" """sets the security manager"""
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
uf._doAddUser('alex', '', ['Member', 'Assignee', 'Assignor', uf._doAddUser('alex', '', ['Member', 'Assignee', 'Assignor',
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testPredicate</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testPredicate</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testPredicate</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
# #
############################################################################## ##############################################################################
import unittest
import mock import mock
from AccessControl.SecurityManagement import noSecurityManager from AccessControl.SecurityManagement import noSecurityManager
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testPreferences</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.tests.testPreferences</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testPreferences</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testProxify</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.tests.testProxify</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testProxify</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testProxyField</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.tests.testProxyField</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testProxyField</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -332,6 +332,7 @@ class TestSelectionPersistence(unittest.TestCase): ...@@ -332,6 +332,7 @@ class TestSelectionPersistence(unittest.TestCase):
self.assertEqual('saved_value', self.assertEqual('saved_value',
portal_selections.getSelectionParamsFor('test_selection').get('key')) portal_selections.getSelectionParamsFor('test_selection').get('key'))
# pylint: disable=abstract-method
class TestSelectionToolMemcachedStorage(TestSelectionTool): class TestSelectionToolMemcachedStorage(TestSelectionTool):
def getTitle(self): def getTitle(self):
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSelectionTool</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.tests.testSelectionTool</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testSelectionTool</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -30,7 +30,6 @@ import unittest ...@@ -30,7 +30,6 @@ import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import LogInterceptor, getExtraSqlConnectionStringList from Products.ERP5Type.tests.utils import LogInterceptor, getExtraSqlConnectionStringList
from Products.ZSQLCatalog.ZSQLCatalog import HOT_REINDEXING_FINISHED_STATE, HOT_REINDEXING_RECORDING_STATE, HOT_REINDEXING_DOUBLE_INDEXING_STATE from Products.ZSQLCatalog.ZSQLCatalog import HOT_REINDEXING_FINISHED_STATE, HOT_REINDEXING_RECORDING_STATE, HOT_REINDEXING_DOUBLE_INDEXING_STATE
from Testing import ZopeTestCase
from zLOG import LOG from zLOG import LOG
class TestVanillaERP5Catalog(ERP5TypeTestCase, LogInterceptor): class TestVanillaERP5Catalog(ERP5TypeTestCase, LogInterceptor):
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testVanillaERP5Catalog</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Catalog.tests.testVanillaERP5Catalog</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testVanillaERP5Catalog</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testVideoField</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Form.tests.testVideoField</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testVideoField</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testXForwardedFor</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5Type.tests.testXForwardedFor</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testXForwardedFor</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
erp5_full_text_mroonga_catalog erp5_full_text_mroonga_catalog
erp5_base erp5_base
erp5_csv_style erp5_csv_style
\ No newline at end of file erp5_core_proxy_field_legacy
\ No newline at end of file
...@@ -2,6 +2,7 @@ test.erp5.testAccessTab ...@@ -2,6 +2,7 @@ test.erp5.testAccessTab
test.erp5.testActivityTool test.erp5.testActivityTool
test.erp5.testAlarm test.erp5.testAlarm
test.erp5.testArrow test.erp5.testArrow
test.erp5.testAudioField
test.erp5.testAutoLogout test.erp5.testAutoLogout
test.erp5.testBase test.erp5.testBase
test.erp5.testBusinessTemplate test.erp5.testBusinessTemplate
...@@ -14,12 +15,16 @@ test.erp5.testCookieCrumbler ...@@ -14,12 +15,16 @@ test.erp5.testCookieCrumbler
test.erp5.testCopySupport test.erp5.testCopySupport
test.erp5.testDateUtils test.erp5.testDateUtils
test.erp5.testERP5Base test.erp5.testERP5Base
test.erp5.testERP5Catalog
test.erp5.testERP5Category test.erp5.testERP5Category
test.erp5.testERP5Coordinate test.erp5.testERP5Coordinate
test.erp5.testERP5Core test.erp5.testERP5Core
test.erp5.testFieldValueCache
test.erp5.testFields
test.erp5.testFolder test.erp5.testFolder
test.erp5.testFolderMigration test.erp5.testFolderMigration
test.erp5.testGeographicalAddress test.erp5.testGeographicalAddress
test.erp5.testHoneypotField
test.erp5.testI18NSearch test.erp5.testI18NSearch
test.erp5.testIdTool test.erp5.testIdTool
test.erp5.testIdToolUpgrade test.erp5.testIdToolUpgrade
...@@ -31,14 +36,22 @@ test.erp5.testNotificationMessageModule ...@@ -31,14 +36,22 @@ test.erp5.testNotificationMessageModule
test.erp5.testNotificationTool test.erp5.testNotificationTool
test.erp5.testPasswordTool test.erp5.testPasswordTool
test.erp5.testPerson test.erp5.testPerson
test.erp5.testPredicate
test.erp5.testPreferences
test.erp5.testProxify
test.erp5.testProxyField
test.erp5.testQueryModule test.erp5.testQueryModule
test.erp5.testRestrictedPythonSecurity test.erp5.testRestrictedPythonSecurity
test.erp5.testSelectionTool
test.erp5.testSessionTool test.erp5.testSessionTool
test.erp5.testTimeout test.erp5.testTimeout
test.erp5.testTimerService test.erp5.testTimerService
test.erp5.testTransactionalVariable test.erp5.testTransactionalVariable
test.erp5.testTrashTool test.erp5.testTrashTool
test.erp5.testVanillaERP5Catalog
test.erp5.testVideoField
test.erp5.testWorkflowHistoryList test.erp5.testWorkflowHistoryList
test.erp5.testWorklist test.erp5.testWorklist
test.erp5.testXForwardedFor
test.erp5.testXMLPickle test.erp5.testXMLPickle
test.erp5.testZODBHistory test.erp5.testZODBHistory
\ No newline at end of file
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
import unittest import unittest
from Products.ERP5.tests.testPredicate import TestPredicateMixIn, \ from erp5.component.test.testPredicate import TestPredicateMixIn, \
REGION_FRANCE_PATH, REGION_GERMANY_PATH, GROUP_STOREVER_PATH REGION_FRANCE_PATH, REGION_GERMANY_PATH, GROUP_STOREVER_PATH
from DateTime import DateTime from DateTime import DateTime
from Products.ZSQLCatalog.SQLCatalog import Query from Products.ZSQLCatalog.SQLCatalog import Query
......
...@@ -8,4 +8,5 @@ erp5_simulation_test ...@@ -8,4 +8,5 @@ erp5_simulation_test
erp5_administration erp5_administration
erp5_mrp erp5_mrp
erp5_accounting erp5_accounting
erp5_dummy_movement erp5_dummy_movement
\ No newline at end of file erp5_core_test
\ No newline at end of file
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