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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
0dafa0a1
Commit
0dafa0a1
authored
Dec 26, 2016
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testBusinessTemplate: add two tests to check that having a space in id raises for
PythonScript and External Method
parent
3b0feea5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
product/ERP5/tests/testBusinessTemplate.py
product/ERP5/tests/testBusinessTemplate.py
+49
-0
No files found.
product/ERP5/tests/testBusinessTemplate.py
View file @
0dafa0a1
...
...
@@ -61,6 +61,7 @@ Transform_manage_beforeDelete = Transform.manage_beforeDelete
from
Products.ERP5.Document.Organisation
import
Organisation
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
ZODB.broken
import
Broken
from
Products.ExternalMethod.ExternalMethod
import
manage_addExternalMethod
instance_home
=
os
.
environ
[
'INSTANCE_HOME'
]
...
...
@@ -6384,6 +6385,54 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""
self
.
test_168_CheckPortalTypeAndPathInSameBusinessTemplate
(
change_broken_object
=
True
)
def
test_170_check_python_script_with_space_in_id_is_not_allowed
(
self
):
"""
Check that adding a PythonScript with space in id raises
"""
python_script_id
=
'ERP5Site_dummyScriptWithSpaceInId '
skin_folder_id
=
'custom'
if
getattr
(
self
.
portal
.
portal_skins
,
skin_folder_id
,
None
)
is
None
:
self
.
portal
.
portal_skins
.
manage_addProduct
[
'OFSP'
].
\
manage_addFolder
(
skin_folder_id
)
skin_folder
=
self
.
portal
.
portal_skins
[
skin_folder_id
]
self
.
assertRaises
(
ValueError
,
skin_folder
.
manage_addProduct
[
'PythonScripts'
].
manage_addPythonScript
,
id
=
python_script_id
)
def
test_171_check_external_method_with_space_in_id_is_not_allowed
(
self
):
"""
Check that adding an External Method with space in id raises
"""
document_id
=
'document'
+
'.erp5.'
+
'FooReference'
component
=
self
.
portal
.
portal_components
.
newContent
(
id
=
document_id
,
version
=
'erp5'
,
title
=
'FooReference'
,
reference
=
'FooReference'
,
text_content
=
'''def testFoo():
return 'foo'
'''
,
portal_type
=
'Extension Component'
,
)
component
.
validate
()
self
.
tic
()
external_method_id
=
'ERP5Site_dummyExternalMethodWithSpaceInId '
skin_folder_id
=
'custom'
if
getattr
(
self
.
portal
.
portal_skins
,
skin_folder_id
,
None
)
is
None
:
self
.
portal
.
portal_skins
.
manage_addProduct
[
'OFSP'
].
\
manage_addFolder
(
skin_folder_id
)
skin_folder
=
self
.
portal
.
portal_skins
[
skin_folder_id
]
self
.
assertRaises
(
ValueError
,
skin_folder
.
manage_addProduct
[
'ExternalMethod'
].
manage_addExternalMethod
,
id
=
external_method_id
,
title
=
''
,
module
=
'FooReference'
,
function
=
'testFoo'
,
)
def
test_type_provider
(
self
):
self
.
portal
.
newContent
(
id
=
'dummy_type_provider'
,
portal_type
=
"Types Tool"
)
type_provider
=
self
.
portal
.
dummy_type_provider
...
...
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