Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
erp5
Commits
c175a161
Commit
c175a161
authored
Jul 19, 2016
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update tests and configurators to handle cloudooo url preferences
parent
7136e773
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
76 additions
and
34 deletions
+76
-34
bt5/erp5_configurator_maxma_demo/SkinTemplateItem/portal_skins/erp5_configurator_maxma_demo/BusinessConfiguration_afterMaxmaDemoConfiguration.py
...demo/BusinessConfiguration_afterMaxmaDemoConfiguration.py
+2
-0
bt5/erp5_configurator_run_my_doc/TestTemplateItem/portal_components/test.erp5.testRunMyDocConfigurationWorkflow.py
...components/test.erp5.testRunMyDocConfigurationWorkflow.py
+2
-0
bt5/erp5_configurator_standard/TestTemplateItem/portal_components/test.erp5.testStandardConfigurationWorkflow.py
...components/test.erp5.testStandardConfigurationWorkflow.py
+1
-0
bt5/erp5_configurator_standard_ui_test/SkinTemplateItem/portal_skins/erp5_configurator_standard_ui_test/Zuite_setUpConfigurationTest.py
...igurator_standard_ui_test/Zuite_setUpConfigurationTest.py
+3
-0
bt5/erp5_configurator_ung/TestTemplateItem/portal_components/test.erp5.testUNGConfigurationWorkflow.py
...rtal_components/test.erp5.testUNGConfigurationWorkflow.py
+2
-0
bt5/erp5_demo_ung/SkinTemplateItem/portal_skins/erp5_demo_ung/Alarm_configureUng.py
...lateItem/portal_skins/erp5_demo_ung/Alarm_configureUng.py
+1
-0
bt5/erp5_dms_conversion_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_preConvertDocumentList.py
...og/erp5_mysql_innodb/SQLCatalog_preConvertDocumentList.py
+2
-1
bt5/erp5_ingestion/TestTemplateItem/portal_components/test.erp5.testLiveIngestion.py
...lateItem/portal_components/test.erp5.testLiveIngestion.py
+1
-0
bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_checkPromiseConversionServer.py
..._skins/erp5_promise/Alarm_checkPromiseConversionServer.py
+1
-1
bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_installPromiseConversionServer.py
...kins/erp5_promise/Alarm_installPromiseConversionServer.py
+1
-6
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_setPreference.py
...tem/portal_skins/erp5_ui_test_core/Zuite_setPreference.py
+4
-0
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_setPreference.xml
...em/portal_skins/erp5_ui_test_core/Zuite_setPreference.xml
+1
-1
bt5/erp5_web_ung_theme/TestTemplateItem/portal_components/test.erp5.testUNG.py
...e/TestTemplateItem/portal_components/test.erp5.testUNG.py
+1
-0
product/ERP5/Tool/IntrospectionTool.py
product/ERP5/Tool/IntrospectionTool.py
+2
-0
product/ERP5/tests/testBase.py
product/ERP5/tests/testBase.py
+1
-0
product/ERP5/tests/testCRM.py
product/ERP5/tests/testCRM.py
+1
-0
product/ERP5/tests/testERP5WebWithCRM.py
product/ERP5/tests/testERP5WebWithCRM.py
+1
-0
product/ERP5/tests/testERP5WebWithDms.py
product/ERP5/tests/testERP5WebWithDms.py
+1
-0
product/ERP5/tests/testWebCrawler.py
product/ERP5/tests/testWebCrawler.py
+1
-0
product/ERP5Configurator/tests/ConfiguratorTestMixin.py
product/ERP5Configurator/tests/ConfiguratorTestMixin.py
+1
-0
product/ERP5Form/tests/testPreferences.py
product/ERP5Form/tests/testPreferences.py
+16
-16
product/ERP5OOo/tests/TestFormPrintoutMixin.py
product/ERP5OOo/tests/TestFormPrintoutMixin.py
+1
-0
product/ERP5OOo/tests/testDms.py
product/ERP5OOo/tests/testDms.py
+1
-0
product/ERP5OOo/tests/testIngestion.py
product/ERP5OOo/tests/testIngestion.py
+2
-0
product/ERP5OOo/tests/testOOoImport.py
product/ERP5OOo/tests/testOOoImport.py
+1
-0
product/ERP5OOo/tests/testOOoStyle.py
product/ERP5OOo/tests/testOOoStyle.py
+1
-0
product/ERP5SyncML/tests/testERP5DocumentSyncML.py
product/ERP5SyncML/tests/testERP5DocumentSyncML.py
+1
-0
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
+1
-0
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+6
-6
product/ERP5Type/tests/runFunctionalTest.py
product/ERP5Type/tests/runFunctionalTest.py
+4
-1
product/ERP5Type/tests/runTestSuite.py
product/ERP5Type/tests/runTestSuite.py
+1
-0
product/ERP5Type/tests/runUnitTest.py
product/ERP5Type/tests/runUnitTest.py
+11
-2
No files found.
bt5/erp5_configurator_maxma_demo/SkinTemplateItem/portal_skins/erp5_configurator_maxma_demo/BusinessConfiguration_afterMaxmaDemoConfiguration.py
View file @
c175a161
...
...
@@ -12,11 +12,13 @@ for obj in portal.portal_catalog(path=["%%/%s" % i.replace("**", "%") for i in b
for
document
in
portal
.
portal_catalog
(
portal_type
=
bt
.
getTemplatePortalTypeRoleList
()):
document
.
updateLocalRolesOnSecurityGroups
()
conversion_server_url
=
portal
.
portal_preferences
.
getPreferredDocumentConversionServerUrl
()
conversion_server_hostname
=
portal
.
portal_preferences
.
getPreferredOoodocServerAddress
()
conversion_server_port
=
portal
.
portal_preferences
.
getPreferredOoodocServerPortNumber
()
for
preference_id
in
[
"default_configurator_preference"
,
"default_configurator_system_preference"
]:
preference
=
getattr
(
portal
.
portal_preferences
,
preference_id
)
if
preference
.
getPortalType
()
==
"System Preference"
:
preference
.
setPreferredDocumentConversionServerUrl
(
conversion_server_url
)
preference
.
setPreferredOoodocServerPortNumber
(
conversion_server_port
)
preference
.
setPreferredOoodocServerAddress
(
conversion_server_hostname
)
...
...
bt5/erp5_configurator_run_my_doc/TestTemplateItem/portal_components/test.erp5.testRunMyDocConfigurationWorkflow.py
View file @
c175a161
...
...
@@ -191,6 +191,8 @@ class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin):
conversion_dict
[
'port'
])
self
.
assertEqual
(
system_preference
.
getPreferredOoodocServerAddress
(),
conversion_dict
[
'hostname'
])
self
.
assertEqual
(
system_preference
.
getPreferredDocumentConversionServerUrl
(),
conversion_dict
[
'url'
])
def
stepCheckUserPreferenceAfterInstallation
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
""" Check System Preference"""
...
...
bt5/erp5_configurator_standard/TestTemplateItem/portal_components/test.erp5.testStandardConfigurationWorkflow.py
View file @
c175a161
...
...
@@ -380,6 +380,7 @@ class StandardConfigurationMixin(TestLiveConfiguratorWorkflowMixin):
# on Business Configuration
#self.assertEqual('localhost', preference_tool.getPreferredOoodocServerAddress())
#self.assertEqual(8011, preference_tool.getPreferredOoodocServerPortNumber())
#self.assertEqual('http://localhost:8011', preference_tool.getPreferredDocumentConversionServerUrl())
# accounting
self
.
assertEqual
(
'group/my_group'
,
...
...
bt5/erp5_configurator_standard_ui_test/SkinTemplateItem/portal_skins/erp5_configurator_standard_ui_test/Zuite_setUpConfigurationTest.py
View file @
c175a161
...
...
@@ -18,6 +18,9 @@ default_site_preference.setPreferredHtmlStyleUnsavedFormWarning(False)
default_site_preference
.
setPreferredHtmlStyleDevelopperMode
(
None
)
default_site_preference
.
setPreferredHtmlStyleAccessTab
(
'1'
)
previous_conversion_server_url
=
portal
.
portal_preferences
.
getPreferredDocumentConversionServerUrl
()
default_site_preference
.
setPreferredDocumentConversionServerUrl
(
previous_conversion_server_url
)
previous_conversion_server_address
=
portal
.
portal_preferences
.
getPreferredOoodocServerAddress
()
default_site_preference
.
setPreferredOoodocServerAddress
(
previous_conversion_server_address
)
...
...
bt5/erp5_configurator_ung/TestTemplateItem/portal_components/test.erp5.testUNGConfigurationWorkflow.py
View file @
c175a161
...
...
@@ -217,6 +217,8 @@ class TestUNGConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin):
conversion_dict
[
'port'
])
self
.
assertEqual
(
system_preference
.
getPreferredOoodocServerAddress
(),
conversion_dict
[
'hostname'
])
self
.
assertEqual
(
system_preference
.
getPreferredDocumentConversionServerUrl
(),
conversion_dict
[
'url'
])
def
stepCheckUserPreferenceAfterInstallation
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
""" Check System Preference"""
...
...
bt5/erp5_demo_ung/SkinTemplateItem/portal_skins/erp5_demo_ung/Alarm_configureUng.py
View file @
c175a161
...
...
@@ -27,4 +27,5 @@ if ung_system_preference is None:
title
=
'UNG System Preference'
)
ung_system_preference
.
setPreferredOoodocServerAddress
(
'localhost'
)
ung_system_preference
.
setPreferredOoodocServerPortNumber
(
'8008'
)
ung_system_preference
.
setPreferredDocumentConversionServerUrl
(
'http://localhost:8008'
)
ung_system_preference
.
enable
()
bt5/erp5_dms_conversion_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_preConvertDocumentList.py
View file @
c175a161
portal
=
context
.
getPortalObject
()
MARKER
=
(
None
,
''
,)
url
=
portal
.
portal_preferences
.
getPreferredDocumentConversionServerUrl
()
address
=
portal
.
portal_preferences
.
getPreferredOoodocServerAddress
()
port
=
portal
.
portal_preferences
.
getPreferredOoodocServerPortNumber
()
# make sure cloudoo is available. this check is required ONLY due to
# unit test nature where a bt5 with a data content which is to be reindexed
# is installed BEFORE the real cloudoo is setup in preferences.
if
address
not
in
MARKER
and
port
not
in
MARKER
:
if
url
not
in
MARKER
or
(
address
not
in
MARKER
and
port
not
in
MARKER
)
:
for
index_uid
in
range
(
len
(
uid
)):
document_relative_url
=
getRelativeUrl
[
index_uid
]
document
=
portal
.
restrictedTraverse
(
document_relative_url
)
...
...
bt5/erp5_ingestion/TestTemplateItem/portal_components/test.erp5.testLiveIngestion.py
View file @
c175a161
...
...
@@ -76,6 +76,7 @@ class TestIngestion(ERP5TypeLiveTestCase):
portal_preferences
=
getToolByName
(
self
.
portal
,
'portal_preferences'
)
default_pref
=
portal_preferences
.
default_site_preference
conversion_dict
=
_getConversionServerDict
()
default_pref
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
default_pref
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
default_pref
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
default_pref
.
setPreferredDocumentFileNameRegularExpression
(
FILE_NAME_REGULAR_EXPRESSION
)
...
...
bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_checkPromiseConversionServer.py
View file @
c175a161
...
...
@@ -7,7 +7,7 @@ promise_url = portal.getPromiseParameter('external_service', 'cloudooo_url')
if
promise_url
is
None
:
return
url
=
"cloudooo://%s:%s/"
%
(
portal_preferences
.
getPreferredOoodocServerAddress
(),
portal_preferences
.
getPreferredOoodocServerPortNumber
()
)
url
=
portal_preferences
.
getPreferredDocumentConversionServerUrl
(
)
active_result
=
ActiveResult
()
...
...
bt5/erp5_promise/SkinTemplateItem/portal_skins/erp5_promise/Alarm_installPromiseConversionServer.py
View file @
c175a161
...
...
@@ -2,10 +2,6 @@ portal = context.getPortalObject()
portal_preferences
=
portal
.
portal_preferences
promise_url
=
portal
.
getPromiseParameter
(
'external_service'
,
'cloudooo_url'
)
domain_port
=
promise_url
.
split
(
'//'
)[
1
].
split
(
'/'
)[
0
]
port
=
domain_port
.
split
(
':'
)[
-
1
]
domain
=
domain_port
[:
-
(
len
(
port
)
+
1
)]
system_preference
=
portal_preferences
.
getActiveSystemPreference
()
if
system_preference
is
None
:
system_preference
=
portal_preferences
.
newContent
(
...
...
@@ -14,6 +10,5 @@ if system_preference is None:
system_preference
.
enable
()
system_preference
.
edit
(
preferred_ooodoc_server_address
=
domain
,
preferred_ooodoc_server_port_number
=
port
,
preferred_document_conversion_server_url
=
promise_url
,
)
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_setPreference.py
View file @
c175a161
...
...
@@ -5,6 +5,9 @@ subversion working copy paths and conversion server address.
It's not meant to be called by zelenium tests directly.
"""
if
conversion_server_url
is
None
and
(
conversion_server_address
is
None
or
conversion_server_port
is
None
):
raise
TypeError
(
"argument conversion_server_url (or conversion_server_{address,port}) should not be None"
)
pref
=
getattr
(
context
.
portal_preferences
,
"erp5_ui_test_preference"
,
None
)
if
pref
is
None
:
pref
=
context
.
portal_preferences
.
newContent
(
id
=
"erp5_ui_test_preference"
,
...
...
@@ -23,6 +26,7 @@ if pref is None:
portal_type
=
"System Preference"
,
priority
=
1
)
pref
.
setPreferredDocumentConversionServerUrl
(
conversion_server_url
)
pref
.
setPreferredOoodocServerAddress
(
conversion_server_hostname
)
pref
.
setPreferredOoodocServerPortNumber
(
conversion_server_port
)
...
...
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_setPreference.xml
View file @
c175a161
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
working_copy_list, conversion_server_hostname
, conversion_server_port
</string>
</value>
<value>
<string>
working_copy_list, conversion_server_hostname
=None, conversion_server_port=None, conversion_server_url=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_web_ung_theme/TestTemplateItem/portal_components/test.erp5.testUNG.py
View file @
c175a161
...
...
@@ -453,6 +453,7 @@ class TestUNG(ERP5TypeTestCase):
portal_contributions
=
portal
.
portal_contributions
system_preference
=
portal_preferences
.
newContent
(
portal_type
=
'System Preference'
)
conversion_dict
=
_getConversionServerDict
()
system_preference
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
"url"
])
system_preference
.
setPreferredOoodocServerAddress
(
conversion_dict
[
"hostname"
])
system_preference
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
"port"
])
system_preference
.
enable
()
...
...
product/ERP5/Tool/IntrospectionTool.py
View file @
c175a161
...
...
@@ -374,6 +374,8 @@ class IntrospectionTool(LogMixin, BaseTool):
'getPreferredOoodocServerAddress'
)
collect_information_by_method
(
system_preference
,
'getPreferredOoodocServerPortNumber'
)
collect_information_by_method
(
system_preference
,
'getPreferredDocumentConversionServerUrl'
)
def
collect_information_by_property
(
document
,
property_id
):
key
=
"%s/%s"
%
(
document
.
getId
(),
property_id
)
...
...
product/ERP5/tests/testBase.py
View file @
c175a161
...
...
@@ -122,6 +122,7 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
def
setDefaultSitePreference
(
self
):
default_pref
=
self
.
portal
.
portal_preferences
.
default_site_preference
conversion_dict
=
_getConversionServerDict
()
default_pref
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
default_pref
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
default_pref
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
if
self
.
portal
.
portal_workflow
.
isTransitionPossible
(
default_pref
,
'enable'
):
...
...
product/ERP5/tests/testCRM.py
View file @
c175a161
...
...
@@ -1019,6 +1019,7 @@ class TestCRMMailSend(BaseTestCRM):
# set preference
default_pref
=
self
.
portal
.
portal_preferences
.
default_site_preference
conversion_dict
=
_getConversionServerDict
()
default_pref
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
default_pref
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
default_pref
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
default_pref
.
setPreferredDocumentFilenameRegularExpression
(
FILENAME_REGULAR_EXPRESSION
)
...
...
product/ERP5/tests/testERP5WebWithCRM.py
View file @
c175a161
...
...
@@ -69,6 +69,7 @@ class TestERP5WebWithCRM(ERP5TypeTestCase):
else
:
preference
=
preference_list
[
0
]
conversion_dict
=
_getConversionServerDict
()
preference
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
preference
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
preference
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
if
self
.
portal
.
portal_workflow
.
isTransitionPossible
(
preference
,
'enable'
):
...
...
product/ERP5/tests/testERP5WebWithDms.py
View file @
c175a161
...
...
@@ -153,6 +153,7 @@ class TestERP5WebWithDms(ERP5TypeTestCase, ZopeTestCase.Functional):
def
setDefaultSitePreference
(
self
):
default_pref
=
self
.
portal
.
portal_preferences
.
default_site_preference
conversion_dict
=
_getConversionServerDict
()
default_pref
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
default_pref
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
default_pref
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
if
self
.
portal
.
portal_workflow
.
isTransitionPossible
(
default_pref
,
'enable'
):
...
...
product/ERP5/tests/testWebCrawler.py
View file @
c175a161
...
...
@@ -95,6 +95,7 @@ class TestWebCrawler(ERP5TypeTestCase):
system_preference
=
portal_preferences
.
newContent
(
id
=
self
.
system_pref_id
,
portal_type
=
'System Preference'
)
conversion_dict
=
_getConversionServerDict
()
system_preference
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
system_preference
.
\
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
system_preference
.
\
...
...
product/ERP5Configurator/tests/ConfiguratorTestMixin.py
View file @
c175a161
...
...
@@ -131,6 +131,7 @@ class TestLiveConfiguratorWorkflowMixin(SecurityTestCase):
else
:
preference
=
preference_list
[
0
]
conversion_dict
=
_getConversionServerDict
()
preference
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
preference
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
preference
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
if
self
.
portal
.
portal_workflow
.
isTransitionPossible
(
preference
,
'enable'
):
...
...
product/ERP5Form/tests/testPreferences.py
View file @
c175a161
...
...
@@ -491,23 +491,23 @@ class TestPreferences(PropertySheetTestCase):
preference_tool
=
self
.
portal
.
portal_preferences
system_pref
=
preference_tool
.
newContent
(
portal_type
=
'System Preference'
,
preferred_
ooodoc_server_address
=
'
127.0.0.1'
,
preferred_
document_conversion_server_url
=
'http://
127.0.0.1'
,
priority
=
Priority
.
SITE
)
# check not taken into account if not enabled
self
.
assertEqual
(
None
,
preference_tool
.
getPreferred
OoodocServerAddress
())
self
.
assertEqual
(
'localhost'
,
preference_tool
.
getPreferred
OoodocServerAddress
(
'
localhost'
))
preference_tool
.
getPreferred
DocumentConversionServerUrl
())
self
.
assertEqual
(
'
http://
localhost'
,
preference_tool
.
getPreferred
DocumentConversionServerUrl
(
'http://
localhost'
))
self
.
assertEqual
(
default_large_image_height
,
preference_tool
.
getPreferredLargeImageHeight
())
# enable it and check preference is returned
self
.
portal
.
portal_workflow
.
doActionFor
(
system_pref
,
'enable_action'
)
self
.
assertEqual
(
system_pref
.
getPreferenceState
(),
'global'
)
self
.
tic
()
self
.
assertEqual
(
'127.0.0.1'
,
preference_tool
.
getPreferred
OoodocServerAddress
())
self
.
assertEqual
(
'127.0.0.1'
,
preference_tool
.
getPreferred
OoodocServerAddress
(
'
localhost'
))
self
.
assertEqual
(
'
http://
127.0.0.1'
,
preference_tool
.
getPreferred
DocumentConversionServerUrl
())
self
.
assertEqual
(
'
http://
127.0.0.1'
,
preference_tool
.
getPreferred
DocumentConversionServerUrl
(
'http://
localhost'
))
self
.
assertEqual
(
default_large_image_height
,
preference_tool
.
getPreferredLargeImageHeight
())
# Default value passed by parameter has priority over the default in the
...
...
@@ -523,12 +523,12 @@ class TestPreferences(PropertySheetTestCase):
# But they can see others
system_pref
.
view
()
# check accessors works
system_pref
.
setPreferred
OoodocServerAddress
(
'
1.2.3.4'
)
system_pref
.
setPreferred
DocumentConversionServerUrl
(
'http://
1.2.3.4'
)
self
.
tic
()
self
.
assertEqual
(
'1.2.3.4'
,
preference_tool
.
getPreferred
OoodocServerAddress
())
self
.
assertEqual
(
'1.2.3.4'
,
preference_tool
.
getPreferred
OoodocServerAddress
(
'
localhost'
))
self
.
assertEqual
(
'
http://
1.2.3.4'
,
preference_tool
.
getPreferred
DocumentConversionServerUrl
())
self
.
assertEqual
(
'
http://
1.2.3.4'
,
preference_tool
.
getPreferred
DocumentConversionServerUrl
(
'http://
localhost'
))
self
.
assertEqual
(
default_large_image_height
,
preference_tool
.
getPreferredLargeImageHeight
())
...
...
@@ -541,15 +541,15 @@ class TestPreferences(PropertySheetTestCase):
self
.
portal
.
portal_workflow
.
doActionFor
(
user_pref
,
'enable_action'
)
self
.
assertEqual
(
user_pref
.
getPreferenceState
(),
'enabled'
)
self
.
tic
()
self
.
assertEqual
(
'1.2.3.4'
,
preference_tool
.
getPreferred
OoodocServerAddress
(
'
localhost'
))
self
.
assertEqual
(
'
http://
1.2.3.4'
,
preference_tool
.
getPreferred
DocumentConversionServerUrl
(
'http://
localhost'
))
self
.
assertEqual
(
large_image_height
,
preference_tool
.
getPreferredLargeImageHeight
())
self
.
assertEqual
(
large_image_height
,
preference_tool
.
getPreferredLargeImageHeight
(
0
))
# check a user can't edit preference which are marked for manager
self
.
assertRaises
(
Unauthorized
,
user_pref
.
edit
,
preferred_
ooodoc_server_address
=
"
localhost"
)
self
.
assertRaises
(
Unauthorized
,
user_pref
.
edit
,
preferred_
document_conversion_server_url
=
"http://
localhost"
)
# even if there is System Preference enabled getActivePreference shall return
# user preference
self
.
assertEqual
(
user_pref
,
preference_tool
.
getActivePreference
())
...
...
product/ERP5OOo/tests/TestFormPrintoutMixin.py
View file @
c175a161
...
...
@@ -50,6 +50,7 @@ class TestFormPrintoutMixin(ERP5TypeTestCase):
def
setSystemPreference
(
self
):
default_pref
=
self
.
portal
.
portal_preferences
.
default_site_preference
conversion_dict
=
_getConversionServerDict
()
default_pref
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
default_pref
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
default_pref
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
#default_pref.setPreferredConversionCacheFactory('document_cache_factory')
...
...
product/ERP5OOo/tests/testDms.py
View file @
c175a161
...
...
@@ -123,6 +123,7 @@ class TestDocumentMixin(ERP5TypeTestCase):
def
setDefaultSitePreference
(
self
):
default_pref
=
self
.
portal
.
portal_preferences
.
default_site_preference
conversion_dict
=
_getConversionServerDict
()
default_pref
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
default_pref
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
default_pref
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
default_pref
.
setPreferredDocumentFilenameRegularExpression
(
FILENAME_REGULAR_EXPRESSION
)
...
...
product/ERP5OOo/tests/testIngestion.py
View file @
c175a161
...
...
@@ -140,6 +140,7 @@ class TestIngestion(ERP5TypeTestCase):
def
setSystemPreference
(
self
):
default_pref
=
self
.
portal
.
portal_preferences
.
default_site_preference
conversion_dict
=
_getConversionServerDict
()
default_pref
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
default_pref
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
default_pref
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
default_pref
.
setPreferredDocumentFilenameRegularExpression
(
FILENAME_REGULAR_EXPRESSION
)
...
...
@@ -1048,6 +1049,7 @@ class TestIngestion(ERP5TypeTestCase):
conversion_dict
=
_getConversionServerDict
()
self
.
assertEqual
(
preference_tool
.
getPreferredOoodocServerAddress
(),
conversion_dict
[
'hostname'
])
self
.
assertEqual
(
preference_tool
.
getPreferredOoodocServerPortNumber
(),
conversion_dict
[
'port'
])
self
.
assertEqual
(
preference_tool
.
getPreferredDocumentConversionServerUrl
(),
conversion_dict
[
'url'
])
self
.
assertEqual
(
preference_tool
.
getPreferredDocumentFilenameRegularExpression
(),
FILENAME_REGULAR_EXPRESSION
)
self
.
assertEqual
(
preference_tool
.
getPreferredDocumentReferenceRegularExpression
(),
REFERENCE_REGULAR_EXPRESSION
)
...
...
product/ERP5OOo/tests/testOOoImport.py
View file @
c175a161
...
...
@@ -58,6 +58,7 @@ class TestOOoImportMixin(ERP5TypeTestCase):
self
.
pref
=
self
.
portal
.
portal_preferences
.
newContent
(
portal_type
=
'System Preference'
)
conversion_dict
=
_getConversionServerDict
()
self
.
pref
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
self
.
pref
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
self
.
pref
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
self
.
pref
.
setPriority
(
Priority
.
SITE
)
...
...
product/ERP5OOo/tests/testOOoStyle.py
View file @
c175a161
...
...
@@ -89,6 +89,7 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
def
setDefaultSitePreference
(
self
):
default_pref
=
self
.
portal
.
portal_preferences
.
default_site_preference
conversion_dict
=
_getConversionServerDict
()
default_pref
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
default_pref
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
default_pref
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
if
self
.
portal
.
portal_workflow
.
isTransitionPossible
(
default_pref
,
'enable'
):
...
...
product/ERP5SyncML/tests/testERP5DocumentSyncML.py
View file @
c175a161
...
...
@@ -150,6 +150,7 @@ class TestERP5DocumentSyncMLMixin(TestERP5SyncMLMixin):
def
setSystemPreferences
(
self
):
default_pref
=
self
.
portal
.
portal_preferences
.
default_site_preference
conversion_dict
=
_getConversionServerDict
()
default_pref
.
setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
default_pref
.
setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
default_pref
.
setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
default_pref
.
setPreferredDocumentFileNameRegularExpression
(
FILENAME_REGULAR_EXPRESSION
)
...
...
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
View file @
c175a161
...
...
@@ -376,6 +376,7 @@ class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
conversion_dict = _getConversionServerDict()
self.portal.Zuite_setPreference(
working_copy_list=bt5_dir_list,
conversion_server_url=conversion_dict['url'],
conversion_server_hostname=conversion_dict['hostname'],
conversion_server_port=conversion_dict['port']
)
...
...
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
c175a161
...
...
@@ -127,13 +127,15 @@ def _getConnectionStringDict():
return
connection_string_dict
def
_getConversionServerDict
():
""" Returns a dict with
hostname and port
for Conversion Server (Oood)
""" Returns a dict with
url
for Conversion Server (Oood)
"""
conversion_server_url
=
os
.
environ
.
get
(
'conversion_server_url'
)
conversion_server_hostname
=
os
.
environ
.
get
(
'conversion_server_hostname'
,
'localhost'
)
conversion_server_port
=
os
.
environ
.
get
(
'conversion_server_port'
,
'8008'
)
return
dict
(
hostname
=
conversion_server_hostname
,
return
dict
(
url
=
conversion_server_url
,
hostname
=
conversion_server_hostname
,
port
=
int
(
conversion_server_port
))
def
_getVolatileMemcachedServerDict
():
...
...
@@ -157,8 +159,7 @@ def _createTestPromiseConfigurationFile(promise_path, bt5_repository_path_list=N
_getVolatileMemcachedServerDict
()
memcached_url
=
"memcached://%(hostname)s:%(port)s/"
%
\
_getPersistentMemcachedServerDict
()
cloudooo_url
=
"cloudooo://%(hostname)s:%(port)s/"
%
\
_getConversionServerDict
()
cloudooo_url
=
_getConversionServerDict
()[
'url'
]
promise_config
=
ConfigParser
.
RawConfigParser
()
promise_config
.
add_section
(
'external_service'
)
...
...
@@ -853,8 +854,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
conversion_dict
=
_getConversionServerDict
()
preference
=
self
.
portal
.
portal_preferences
[
self
.
getDefaultSitePreferenceId
()]
preference
.
_setPreferredOoodocServerAddress
(
conversion_dict
[
'hostname'
])
preference
.
_setPreferredOoodocServerPortNumber
(
conversion_dict
[
'port'
])
preference
.
_setPreferredDocumentConversionServerUrl
(
conversion_dict
[
'url'
])
def
_updateMemcachedConfiguration
(
self
):
"""Update default memcached plugin configuration
...
...
product/ERP5Type/tests/runFunctionalTest.py
View file @
c175a161
...
...
@@ -281,15 +281,18 @@ user_pref("capability.principal.codebase.p1.subjectName", "");""" % \
return
status
def
setPreference
(
self
):
conversion_server_url
=
os
.
environ
.
get
(
'conversion_server_url'
,
''
)
conversion_server_hostname
=
os
.
environ
.
get
(
'conversion_server_hostname'
,
'localhost'
)
conversion_server_port
=
os
.
environ
.
get
(
'conversion_server_port'
,
'8008'
)
urllib2
.
urlopen
(
'%s/Zuite_setPreference?__ac_name='
'%s&__ac_password=%s&working_copy_list=%s'
'&conversion_server_url=%s'
'&conversion_server_hostname=%s'
'&conversion_server_port=%s'
%
(
self
.
portal_url
,
self
.
user
,
self
.
password
,
bt5_dir_list
,
conversion_server_hostname
,
bt5_dir_list
,
conversion_server_url
,
conversion_server_hostname
,
conversion_server_port
))
...
...
product/ERP5Type/tests/runTestSuite.py
View file @
c175a161
...
...
@@ -53,6 +53,7 @@ def main():
default
=
None
)
parser
.
add_argument
(
'--db_list'
,
help
=
'A list of sql connection strings'
)
# parameters that needs to be passed to runUnitTest
parser
.
add_argument
(
'--conversion_server_url'
,
default
=
None
)
parser
.
add_argument
(
'--conversion_server_hostname'
,
default
=
None
)
parser
.
add_argument
(
'--conversion_server_port'
,
default
=
None
)
parser
.
add_argument
(
'--volatile_memcached_server_hostname'
,
default
=
None
)
...
...
product/ERP5Type/tests/runUnitTest.py
View file @
c175a161
...
...
@@ -99,14 +99,20 @@ Options:
for performance reasons. Provide list of documents
(delimited with comas) for which we want to force
indexing. This can only be for now 'portal_types'
--conversion_server_url=STRING
URL used to connect to document conversion server,
this value will stored at default preference.
Empty by default.
--conversion_server_hostname=STRING
Hostname used to connect to conversion server (Oood),
this value will stored at default preference.
By default localhost is used.
Ignored if --conversion_server_url is not empty.
By default localhost is used. DEPRECATED
--conversion_server_port=STRING
Port number used to connect to conversion server
(Oood), the value will be stored at default preference.
By default 8008 is used.
Ignored if --conversion_server_url is not empty.
By default 8008 is used. DEPRECATED
--volatile_memcached_server_hostname=STRING
Hostname used to connect to volatile memcached server,
this value will stored on portal_memcached.
...
...
@@ -690,6 +696,7 @@ def main(argument_list=None):
"recreate_catalog="
,
"erp5_sql_connection_string="
,
"cmf_activity_sql_connection_string="
,
"extra_sql_connection_string_list="
,
"conversion_server_url="
,
"conversion_server_port="
,
"conversion_server_hostname="
,
"volatile_memcached_server_port="
,
...
...
@@ -790,6 +797,8 @@ def main(argument_list=None):
os
.
environ
[
"update_business_templates"
]
=
"1"
elif
opt
==
"--update_business_templates"
:
os
.
environ
[
"update_business_templates"
]
=
"1"
elif
opt
==
"--conversion_server_url"
:
os
.
environ
[
"conversion_server_url"
]
=
arg
elif
opt
==
"--conversion_server_hostname"
:
os
.
environ
[
"conversion_server_hostname"
]
=
arg
elif
opt
==
"--conversion_server_port"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment