Commit 59571d6d authored by Arnaud Fontaine's avatar Arnaud Fontaine

WIP

parent 4645e7b4
...@@ -29,11 +29,12 @@ ...@@ -29,11 +29,12 @@
import unittest import unittest
import os import os
from Products.ERP5OOo.OOoUtils import OOoParser from erp5.component.module.OOoUtils import OOoParser
def makeFilePath(name): def makeFilePath(name):
return os.path.join(os.path.dirname(__file__), 'test_document', name) import Products.ERP5
return os.path.join(os.path.dirname(Products.ERP5.__file__), 'test_data', name)
class TestOOoParser(unittest.TestCase): class TestOOoParser(unittest.TestCase):
""" OOoParser tests """ OOoParser tests
...@@ -45,7 +46,7 @@ class TestOOoParser(unittest.TestCase): ...@@ -45,7 +46,7 @@ class TestOOoParser(unittest.TestCase):
self.assertEqual(['Person'], mapping.keys()) self.assertEqual(['Person'], mapping.keys())
person_mapping = mapping['Person'] person_mapping = mapping['Person']
self.assertTrue(isinstance(person_mapping, list)) self.assertTrue(isinstance(person_mapping, list))
self.assertTrue(102, len(person_mapping)) self.assertEqual(len(person_mapping), 102)
self.assertEqual(person_mapping[0], self.assertEqual(person_mapping[0],
['Title', 'First Name', 'Last Name', 'Default Email Text']) ['Title', 'First Name', 'Last Name', 'Default Email Text'])
self.assertEqual(person_mapping[1], self.assertEqual(person_mapping[1],
...@@ -99,7 +100,7 @@ class TestOOoParser(unittest.TestCase): ...@@ -99,7 +100,7 @@ class TestOOoParser(unittest.TestCase):
parser.openFile(open(makeFilePath('import_big_spreadsheet.ods'), 'rb')) parser.openFile(open(makeFilePath('import_big_spreadsheet.ods'), 'rb'))
mapping = parser.getSpreadsheetsMapping() mapping = parser.getSpreadsheetsMapping()
not_ok = 1 not_ok = 1
for spread, values in mapping.iteritems(): for _, values in mapping.iteritems():
self.assertEqual(len(values), 41001) self.assertEqual(len(values), 41001)
not_ok = 0 not_ok = 0
if not_ok: if not_ok:
......
<?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>testOOoParser</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5OOo.tests.testOOoParser</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testOOoParser</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,6 +30,7 @@ test.erp5.testMemcachedTool ...@@ -30,6 +30,7 @@ test.erp5.testMemcachedTool
test.erp5.testNotificationMessageModule test.erp5.testNotificationMessageModule
test.erp5.testNotificationTool test.erp5.testNotificationTool
test.erp5.testOOoBatchMode test.erp5.testOOoBatchMode
test.erp5.testOOoParser
test.erp5.testPerson test.erp5.testPerson
test.erp5.testQueryModule test.erp5.testQueryModule
test.erp5.testRestrictedPythonSecurity test.erp5.testRestrictedPythonSecurity
......
...@@ -118,13 +118,13 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -118,13 +118,13 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
def test_report_view(self): def test_report_view(self):
self.loginAsUser('bob') self.loginAsUser('bob')
self.portal.changeSkin('Deferred') self.portal.changeSkin('Deferred')
response = self.publish( self.publish(
'/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s' '/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s'
% (self.portal.getId(), self.skin), '%s:%s' % (self.username, self.password)) % (self.portal.getId(), self.skin), '%s:%s' % (self.username, self.password))
self.tic() self.tic()
last_message = self.portal.MailHost._last_message last_message = self.portal.MailHost._last_message
self.assertNotEquals((), last_message) self.assertNotEquals((), last_message)
mfrom, mto, message_text = last_message _, mto, message_text = last_message
self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0]) self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0])
mail_message = email.message_from_string(message_text) mail_message = email.message_from_string(message_text)
for part in mail_message.walk(): for part in mail_message.walk():
...@@ -181,7 +181,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -181,7 +181,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
self._defineSystemPreference() self._defineSystemPreference()
self.loginAsUser('bob') self.loginAsUser('bob')
self.portal.changeSkin('Deferred') self.portal.changeSkin('Deferred')
response = self.publish( self.publish(
'/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s' '/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s'
% (self.portal.getId(), self.skin), '%s:%s' % (self.username, self.password)) % (self.portal.getId(), self.skin), '%s:%s' % (self.username, self.password))
self.tic() self.tic()
...@@ -189,7 +189,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -189,7 +189,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
last_message = self.portal.MailHost._last_message last_message = self.portal.MailHost._last_message
self.assertNotEquals((), last_message) self.assertNotEquals((), last_message)
mfrom, mto, message_text = last_message _, mto, message_text = last_message
self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0]) self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0])
mail_message = email.message_from_string(message_text) mail_message = email.message_from_string(message_text)
for part in mail_message.walk(): for part in mail_message.walk():
...@@ -219,7 +219,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -219,7 +219,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
self._defineSystemPreference("notification-deferred.report") self._defineSystemPreference("notification-deferred.report")
self.loginAsUser('bob') self.loginAsUser('bob')
self.portal.changeSkin('Deferred') self.portal.changeSkin('Deferred')
response = self.publish( self.publish(
'/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s' '/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s'
% (self.portal.getId(), self.skin), '%s:%s' % (self.username, self.password)) % (self.portal.getId(), self.skin), '%s:%s' % (self.username, self.password))
self.tic() self.tic()
...@@ -227,7 +227,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -227,7 +227,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
last_message = self.portal.MailHost._last_message last_message = self.portal.MailHost._last_message
self.assertNotEquals((), last_message) self.assertNotEquals((), last_message)
mfrom, mto, message_text = last_message _, mto, message_text = last_message
self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0]) self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0])
mail_message = email.message_from_string(message_text) mail_message = email.message_from_string(message_text)
for part in mail_message.walk(): for part in mail_message.walk():
...@@ -242,7 +242,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -242,7 +242,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
self._defineSystemPreference() self._defineSystemPreference()
self.loginAsUser('bob') self.loginAsUser('bob')
self.portal.changeSkin('Deferred') self.portal.changeSkin('Deferred')
response = self.publish( self.publish(
'/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s&format=pdf' '/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s&format=pdf'
% (self.portal.getId(), self.skin), '%s:%s' % (self.username, self.password)) % (self.portal.getId(), self.skin), '%s:%s' % (self.username, self.password))
self.tic() self.tic()
...@@ -251,7 +251,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -251,7 +251,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
last_message = self.portal.MailHost._last_message last_message = self.portal.MailHost._last_message
self.assertNotEquals((), last_message) self.assertNotEquals((), last_message)
mfrom, mto, message_text = last_message _, mto, message_text = last_message
self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0]) self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0])
mail_message = email.message_from_string(message_text) mail_message = email.message_from_string(message_text)
for part in mail_message.walk(): for part in mail_message.walk():
...@@ -266,7 +266,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -266,7 +266,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
self.loginAsUser('bob') self.loginAsUser('bob')
# simulate a big request, for which Base_callDialogMethod will not issue a # simulate a big request, for which Base_callDialogMethod will not issue a
# redirect # redirect
response = self.publish( self.publish(
'/%s/person_module/pers/Base_callDialogMethod?deferred_portal_skin=%s&' '/%s/person_module/pers/Base_callDialogMethod?deferred_portal_skin=%s&'
'dialog_method=Person_view&dialog_id=Person_view&' 'dialog_method=Person_view&dialog_id=Person_view&'
'deferred_style:int=1&junk=%s' % (self.portal.getId(), 'deferred_style:int=1&junk=%s' % (self.portal.getId(),
...@@ -276,7 +276,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -276,7 +276,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
self.tic() self.tic()
last_message = self.portal.MailHost._last_message last_message = self.portal.MailHost._last_message
self.assertNotEquals((), last_message) self.assertNotEquals((), last_message)
mfrom, mto, message_text = last_message _, mto, message_text = last_message
self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0]) self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0])
mail_message = email.message_from_string(message_text) mail_message = email.message_from_string(message_text)
for part in mail_message.walk(): for part in mail_message.walk():
...@@ -300,7 +300,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -300,7 +300,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
# User's Accept-Language header is honored in reports. # User's Accept-Language header is honored in reports.
self.loginAsUser('bob') self.loginAsUser('bob')
self.portal.changeSkin('Deferred') self.portal.changeSkin('Deferred')
response = self.publish( self.publish(
'/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s' '/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s'
% (self.portal.getId(), self.skin), % (self.portal.getId(), self.skin),
'%s:%s' % (self.username, self.password), '%s:%s' % (self.username, self.password),
...@@ -325,7 +325,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -325,7 +325,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
# User's LOCALIZER_LANGUAGE cookie is honored in reports and have priority over Accept-Language # User's LOCALIZER_LANGUAGE cookie is honored in reports and have priority over Accept-Language
self.loginAsUser('bob') self.loginAsUser('bob')
self.portal.changeSkin('Deferred') self.portal.changeSkin('Deferred')
response = self.publish( self.publish(
'/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s' '/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s'
% (self.portal.getId(), self.skin), % (self.portal.getId(), self.skin),
'%s:%s' % (self.username, self.password), '%s:%s' % (self.username, self.password),
...@@ -366,13 +366,13 @@ class TestODSDeferredStyle(TestDeferredStyle): ...@@ -366,13 +366,13 @@ class TestODSDeferredStyle(TestDeferredStyle):
""" """
self.loginAsUser('bob') self.loginAsUser('bob')
self.portal.changeSkin('Deferred') self.portal.changeSkin('Deferred')
response = self.publish( self.publish(
'/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s&sheet_per_report_section:int=1' '/%s/person_module/pers/Base_viewHistory?deferred_portal_skin=%s&sheet_per_report_section:int=1'
% (self.portal.getId(), self.skin), '%s:%s' % (self.username, self.password)) % (self.portal.getId(), self.skin), '%s:%s' % (self.username, self.password))
self.tic() self.tic()
last_message = self.portal.MailHost._last_message last_message = self.portal.MailHost._last_message
self.assertNotEquals((), last_message) self.assertNotEquals((), last_message)
mfrom, mto, message_text = last_message _, mto, message_text = last_message
self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0]) self.assertEqual('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0])
mail_message = email.message_from_string(message_text) mail_message = email.message_from_string(message_text)
for part in mail_message.walk(): for part in mail_message.walk():
......
<?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>testDeferredStyle</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5OOo.tests.testDeferredStyle</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testDeferredStyle</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>
test.erp5.testDeferredStyle
\ No newline at end of file
erp5_full_text_mroonga_catalog
erp5_core_proxy_field_legacy
erp5_base
erp5_ods_style
erp5_ingestion_mysql_innodb_catalog
erp5_ingestion
erp5_web
erp5_dms
erp5_l10n_fr
\ No newline at end of file
<?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>testIngestion</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5OOo.tests.testIngestion</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testIngestion</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,7 @@ ...@@ -28,7 +28,7 @@
############################################################################## ##############################################################################
import unittest import unittest
from testIngestion import TestIngestion from erp5.component.test.testIngestion import TestIngestion
from Products.ERP5Type.tests.ERP5TypeTestCase import _getPersistentMemcachedServerDict from Products.ERP5Type.tests.ERP5TypeTestCase import _getPersistentMemcachedServerDict
class TestIngestionWithFlare(TestIngestion): class TestIngestionWithFlare(TestIngestion):
......
<?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>testIngestionWithFlare</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5OOo.tests.testIngestionWithFlare</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testIngestionWithFlare</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>
test.erp5.testDms test.erp5.testDms
test.erp5.testDmsWithFlare test.erp5.testDmsWithFlare
test.erp5.testERP5WebWithDms test.erp5.testERP5WebWithDms
test.erp5.testIngestion
test.erp5.testIngestionWithFlare
test.erp5.testOOoConversionCache test.erp5.testOOoConversionCache
test.erp5.testOOoConversionServerRetry test.erp5.testOOoConversionServerRetry
\ No newline at end of file
erp5_full_text_mroonga_catalog erp5_full_text_mroonga_catalog
erp5_ingestion_mysql_innodb_catalog erp5_ingestion_mysql_innodb_catalog
\ No newline at end of file erp5_core_proxy_field_legacy
\ No newline at end of file
...@@ -40,7 +40,7 @@ class TestFormPrintoutMixin(ERP5TypeTestCase): ...@@ -40,7 +40,7 @@ class TestFormPrintoutMixin(ERP5TypeTestCase):
def getBusinessTemplateList(self): def getBusinessTemplateList(self):
return ('erp5_base', 'erp5_ui_test', 'erp5_odt_style') return ('erp5_base', 'erp5_ui_test', 'erp5_odt_style')
def login(self): def login(self, *args, **kw):
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
uf._doAddUser('zope', '', ['Manager'], []) uf._doAddUser('zope', '', ['Manager'], [])
user = uf.getUserById('zope').__of__(uf) user = uf.getUserById('zope').__of__(uf)
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Module Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>TestFormPrintoutMixin</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5OOo.tests.TestFormPrintoutMixin</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>module.erp5.TestFormPrintoutMixin</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Module 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,8 +28,9 @@ ...@@ -28,8 +28,9 @@
############################################################################## ##############################################################################
import unittest import unittest
from Products.ERP5OOo.tests.TestFormPrintoutMixin import TestFormPrintoutMixin import Products.ERP5
from Products.ERP5OOo.OOoUtils import OOoBuilder from erp5.component.module.TestFormPrintoutMixin import TestFormPrintoutMixin
from erp5.component.module.OOoUtils import OOoBuilder
from Products.ERP5OOo.tests.utils import Validator from Products.ERP5OOo.tests.utils import Validator
from Products.ERP5Type.tests.utils import FileUpload from Products.ERP5Type.tests.utils import FileUpload
from lxml import etree from lxml import etree
...@@ -56,12 +57,13 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin): ...@@ -56,12 +57,13 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
def afterSetUp(self): def afterSetUp(self):
self.login() self.login()
# XML validator # XML validator
v12schema_url = os.path.join(os.path.dirname(__file__), v12schema_url = os.path.join(os.path.dirname(Products.ERP5.__file__),
'test_data',
'OpenDocument-v1.2-os-schema.rng') 'OpenDocument-v1.2-os-schema.rng')
self.validator = Validator(schema_url=v12schema_url) self.validator = Validator(schema_url=v12schema_url)
foo_file_path = os.path.join(os.path.dirname(__file__), foo_file_path = os.path.join(os.path.dirname(Products.ERP5.__file__),
'test_document', 'test_data',
'Foo_001.odg') 'Foo_001.odg')
foo_file = open(foo_file_path, 'rb') foo_file = open(foo_file_path, 'rb')
self._validate(foo_file.read()) self._validate(foo_file.read())
......
<?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>testFormPrintoutAsODG</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5OOo.tests.testFormPrintoutAsODG</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testFormPrintoutAsODG</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>
...@@ -30,11 +30,12 @@ ...@@ -30,11 +30,12 @@
############################################################################## ##############################################################################
import unittest import unittest
import Products.ERP5
from unittest import skip from unittest import skip
from Products.ERP5OOo.tests.TestFormPrintoutMixin import TestFormPrintoutMixin from erp5.component.module.TestFormPrintoutMixin import TestFormPrintoutMixin
from Products.ERP5Type.tests.utils import createZODBPythonScript from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.MimetypesRegistry.mime_types.magic import guessMime from Products.MimetypesRegistry.mime_types.magic import guessMime
from Products.ERP5OOo.OOoUtils import OOoBuilder from erp5.component.module.OOoUtils import OOoBuilder
from Products.ERP5OOo.tests.utils import Validator from Products.ERP5OOo.tests.utils import Validator
from Products.ERP5Type.tests.utils import FileUpload from Products.ERP5Type.tests.utils import FileUpload
from DateTime import DateTime from DateTime import DateTime
...@@ -52,27 +53,28 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin): ...@@ -52,27 +53,28 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin):
def afterSetUp(self): def afterSetUp(self):
self.login() self.login()
# XML validator # XML validator
v12schema_url = os.path.join(os.path.dirname(__file__), v12schema_url = os.path.join(os.path.dirname(Products.ERP5.__file__),
'test_data',
'OpenDocument-v1.2-os-schema.rng') 'OpenDocument-v1.2-os-schema.rng')
self.validator = Validator(schema_url=v12schema_url) self.validator = Validator(schema_url=v12schema_url)
foo_file_path = os.path.join(os.path.dirname(__file__), foo_file_path = os.path.join(os.path.dirname(Products.ERP5.__file__),
'test_document', 'test_data',
'Foo_001.odt') 'Foo_001.odt')
foo2_file_path = os.path.join(os.path.dirname(__file__), foo2_file_path = os.path.join(os.path.dirname(Products.ERP5.__file__),
'test_document', 'test_data',
'Foo_002.odt') 'Foo_002.odt')
foo3_file_path = os.path.join(os.path.dirname(__file__), foo3_file_path = os.path.join(os.path.dirname(Products.ERP5.__file__),
'test_document', 'test_data',
'Foo_003.odt') 'Foo_003.odt')
foo4_file_path = os.path.join(os.path.dirname(__file__), foo4_file_path = os.path.join(os.path.dirname(Products.ERP5.__file__),
'test_document', 'test_data',
'Foo_004.odt') 'Foo_004.odt')
foo5_file_path = os.path.join(os.path.dirname(__file__), foo5_file_path = os.path.join(os.path.dirname(Products.ERP5.__file__),
'test_document', 'test_data',
'Foo_005.odt') 'Foo_005.odt')
variable_file_path = os.path.join(os.path.dirname(__file__), variable_file_path = os.path.join(os.path.dirname(Products.ERP5.__file__),
'test_document', 'test_data',
'Foo_001_with_variable.odt') 'Foo_001_with_variable.odt')
foo_file = open(foo_file_path, 'rb') foo_file = open(foo_file_path, 'rb')
foo2_file = open(foo2_file_path, 'rb') foo2_file = open(foo2_file_path, 'rb')
...@@ -154,7 +156,7 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin): ...@@ -154,7 +156,7 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin):
self.assertEqual(request.RESPONSE.getHeader('content-disposition'), self.assertEqual(request.RESPONSE.getHeader('content-disposition'),
'inline;filename="Foo_viewAsPrintout.odt"') 'inline;filename="Foo_viewAsPrintout.odt"')
self._validate(odf_document) self._validate(odf_document)
pdf_document = foo_printout.index_html(REQUEST=request, format='pdf') foo_printout.index_html(REQUEST=request, format='pdf')
self.assertEqual(request.RESPONSE.getHeader('content-type'), self.assertEqual(request.RESPONSE.getHeader('content-type'),
'application/pdf') 'application/pdf')
self.assertEqual(request.RESPONSE.getHeader('content-disposition'), self.assertEqual(request.RESPONSE.getHeader('content-disposition'),
...@@ -505,7 +507,6 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin): ...@@ -505,7 +507,6 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin):
test1 = self.portal.foo_module.test1 test1 = self.portal.foo_module.test1
foo_printout = test1.Foo_viewAsPrintout foo_printout = test1.Foo_viewAsPrintout
foo_form = test1.Foo_view foo_form = test1.Foo_view
listbox = foo_form.listbox
request = self.app.REQUEST request = self.app.REQUEST
request['here'] = test1 request['here'] = test1
...@@ -564,7 +565,6 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin): ...@@ -564,7 +565,6 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin):
test1 = self.portal.foo_module.test1 test1 = self.portal.foo_module.test1
foo_printout = test1.Foo_viewAsPrintout foo_printout = test1.Foo_viewAsPrintout
foo_form = test1.Foo_view foo_form = test1.Foo_view
listbox = foo_form.listbox
request = self.app.REQUEST request = self.app.REQUEST
request['here'] = test1 request['here'] = test1
...@@ -685,7 +685,6 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin): ...@@ -685,7 +685,6 @@ class TestFormPrintoutAsODT(TestFormPrintoutMixin):
test1 = self.portal.foo_module.test1 test1 = self.portal.foo_module.test1
foo_printout = test1.Foo_viewAsPrintout foo_printout = test1.Foo_viewAsPrintout
foo_form = test1.Foo_view foo_form = test1.Foo_view
listbox = foo_form.listbox
request = self.app.REQUEST request = self.app.REQUEST
request['here'] = test1 request['here'] = test1
......
<?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>testFormPrintoutAsODT</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5OOo.tests.testFormPrintoutAsODT</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testFormPrintoutAsODT</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>
module.erp5.TestFormPrintoutMixin
\ No newline at end of file
test.erp5.testFormPrintoutAsODG
test.erp5.testFormPrintoutAsODT
\ No newline at end of file
erp5_full_text_mroonga_catalog
erp5_base
erp5_ui_test
\ No newline at end of file
...@@ -34,11 +34,12 @@ from AccessControl.SecurityManagement import newSecurityManager ...@@ -34,11 +34,12 @@ from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import FileUpload from Products.ERP5Type.tests.utils import FileUpload
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5OOo.OOoUtils import OOoParser from erp5.component.module.OOoUtils import OOoParser
from DateTime import DateTime from DateTime import DateTime
def makeFilePath(name): def makeFilePath(name):
return os.path.join(os.path.dirname(__file__), 'test_document', name) import Products.ERP5
return os.path.join(os.path.dirname(Products.ERP5.__file__), 'test_data', name)
def makeFileUpload(name): def makeFileUpload(name):
path = makeFilePath(name) path = makeFilePath(name)
...@@ -887,7 +888,7 @@ class TestOOoImport(TestOOoImportMixin): ...@@ -887,7 +888,7 @@ class TestOOoImport(TestOOoImportMixin):
parser.openFile(open(makeFilePath('import_big_spreadsheet.ods'), 'rb')) parser.openFile(open(makeFilePath('import_big_spreadsheet.ods'), 'rb'))
mapping = parser.getSpreadsheetsMapping() mapping = parser.getSpreadsheetsMapping()
not_ok = 1 not_ok = 1
for spread, values in mapping.iteritems(): for _, values in mapping.iteritems():
self.assertEqual(len(values), 41001) self.assertEqual(len(values), 41001)
not_ok = 0 not_ok = 0
if not_ok: if not_ok:
......
<?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>testOOoImport</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5OOo.tests.testOOoImport</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testOOoImport</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>
test.erp5.testOOoImport
\ No newline at end of file
erp5_full_text_mroonga_catalog
erp5_base
erp5_web
\ No newline at end of file
...@@ -38,6 +38,7 @@ from zope.tal.talinterpreter import FasterStringIO ...@@ -38,6 +38,7 @@ from zope.tal.talinterpreter import FasterStringIO
from Products.ERP5Type import PropertySheet from Products.ERP5Type import PropertySheet
from urllib import quote from urllib import quote
from Products.ERP5Type.Globals import InitializeClass, DTMLFile from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5 import _dtmldir
from Acquisition import aq_base from Acquisition import aq_base
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from erp5.component.module.OOoUtils import OOoBuilder from erp5.component.module.OOoUtils import OOoBuilder
...@@ -45,6 +46,8 @@ from zipfile import ZipFile, ZIP_DEFLATED ...@@ -45,6 +46,8 @@ from zipfile import ZipFile, ZIP_DEFLATED
from cStringIO import StringIO from cStringIO import StringIO
import re import re
import itertools import itertools
import os.path
import Products.ERP5
try: try:
# pylint: disable=no-name-in-module,unused-import # pylint: disable=no-name-in-module,unused-import
...@@ -58,7 +61,7 @@ from lxml import etree ...@@ -58,7 +61,7 @@ from lxml import etree
from lxml.etree import Element from lxml.etree import Element
# Constructors # Constructors
manage_addOOoTemplate = DTMLFile("dtml/OOoTemplate_add", globals()) manage_addOOoTemplate = DTMLFile("dtml/OOoTemplate_add", _dtmldir)
def addOOoTemplate(self, id, title="", xml_file_id="content.xml", REQUEST=None): # pylint: disable=redefined-builtin def addOOoTemplate(self, id, title="", xml_file_id="content.xml", REQUEST=None): # pylint: disable=redefined-builtin
"""Add OOo template to folder. """Add OOo template to folder.
...@@ -145,7 +148,7 @@ class OOoTemplate(Base, ZopePageTemplate): ...@@ -145,7 +148,7 @@ class OOoTemplate(Base, ZopePageTemplate):
""" """
meta_type = "ERP5 OOo Template" meta_type = "ERP5 OOo Template"
portal_type = "OOo Template" portal_type = "OOo Template"
icon = "www/OOo.png" icon = os.path.join(os.path.dirname(Products.ERP5.__file__), "www", "OOo.png")
# NOTE: 100 is just pure random starting number # NOTE: 100 is just pure random starting number
# it won't influence the code at all # it won't influence the code at all
...@@ -176,8 +179,9 @@ class OOoTemplate(Base, ZopePageTemplate): ...@@ -176,8 +179,9 @@ class OOoTemplate(Base, ZopePageTemplate):
) )
security.declareProtected('View management screens', 'formSettings') security.declareProtected('View management screens', 'formSettings')
formSettings = PageTemplateFile('www/formSettings', globals(), formSettings = PageTemplateFile(
__name__='formSettings') os.path.join(os.path.dirname(Products.ERP5.__file__), 'www', 'formSettings'),
__name__='formSettings')
formSettings._owner = None formSettings._owner = None
def __init__(self, id, title='', *args, **kw): # pylint: disable=redefined-builtin def __init__(self, id, title='', *args, **kw): # pylint: disable=redefined-builtin
......
...@@ -558,3 +558,6 @@ allow_class(CorruptedOOoFile) ...@@ -558,3 +558,6 @@ allow_class(CorruptedOOoFile)
def newOOoParser(container): def newOOoParser(container):
return OOoParser().__of__(container) return OOoParser().__of__(container)
from AccessControl import ModuleSecurityInfo
ModuleSecurityInfo(__name__).declarePublic('OOoParser',)
ModuleSecurityInfo(__name__).declarePublic('newOOoParser',)
\ No newline at end of file
This diff is collapsed.
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