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
Paul Graydon
erp5
Commits
a87da503
Commit
a87da503
authored
Apr 30, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core_test: style fixes
parent
b9beb439
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBusinessTemplate.py
...eItem/portal_components/test.erp5.testBusinessTemplate.py
+5
-5
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+3
-3
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBusinessTemplate.py
View file @
a87da503
...
@@ -212,7 +212,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
...
@@ -212,7 +212,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
Get a business template at portal_templates
Get a business template at portal_templates
"""
"""
template_tool
=
self
.
getTemplateTool
()
template_tool
=
self
.
getTemplateTool
()
for
bt
in
template_tool
.
objectValues
(
filter
=
{
'portal_type'
:
'Business Template'
}):
for
bt
in
template_tool
.
objectValues
(
filter
=
{
'portal_type'
:
'Business Template'
}):
if
bt
.
getTitle
()
==
title
:
if
bt
.
getTitle
()
==
title
:
return
bt
return
bt
return
None
return
None
...
@@ -2640,7 +2640,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
...
@@ -2640,7 +2640,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
import_bt
=
sequence
.
get
(
'import_bt'
)
import_bt
=
sequence
.
get
(
'import_bt'
)
pc
=
self
.
getCatalogTool
()
pc
=
self
.
getCatalogTool
()
catalog_id
=
pc
.
getSQLCatalog
().
id
catalog_id
=
pc
.
getSQLCatalog
().
id
object_to_update
=
{
'portal_catalog/'
+
catalog_id
+
'/z_another_fake_method'
:
'install'
}
object_to_update
=
{
'portal_catalog/'
+
catalog_id
+
'/z_another_fake_method'
:
'install'
}
import_bt
.
install
(
object_to_update
=
object_to_update
)
import_bt
.
install
(
object_to_update
=
object_to_update
)
def
stepCreateNewBusinessTemplate
(
self
,
sequence
=
None
,
**
kw
):
def
stepCreateNewBusinessTemplate
(
self
,
sequence
=
None
,
**
kw
):
...
@@ -2822,7 +2822,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
...
@@ -2822,7 +2822,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
'template_portal_type_hidden_content_type_list'
,
'template_portal_type_hidden_content_type_list'
,
'template_portal_type_property_sheet_list'
,
'template_portal_type_property_sheet_list'
,
'template_portal_type_base_category_list'
):
'template_portal_type_base_category_list'
):
continue
continue
if
prop_type
==
'text'
or
prop_type
==
'string'
:
if
prop_type
==
'text'
or
prop_type
==
'string'
:
prop_dict
[
pid
]
=
''
prop_dict
[
pid
]
=
''
elif
prop_type
==
'int'
:
elif
prop_type
==
'int'
:
...
@@ -3141,7 +3141,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
...
@@ -3141,7 +3141,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
python_script_id
=
'ERP5Site_dummyScriptWhichRandomId%s'
%
grain_of_sand
python_script_id
=
'ERP5Site_dummyScriptWhichRandomId%s'
%
grain_of_sand
skin_folder_id
=
'custom'
skin_folder_id
=
'custom'
if
getattr
(
self
.
portal
.
portal_skins
,
skin_folder_id
,
None
)
is
None
:
if
getattr
(
self
.
portal
.
portal_skins
,
skin_folder_id
,
None
)
is
None
:
self
.
portal
.
portal_skins
.
manage_addProduct
[
'OFSP'
].
manage_addFolder
(
skin_folder_id
)
self
.
portal
.
portal_skins
.
manage_addProduct
[
'OFSP'
].
manage_addFolder
(
skin_folder_id
)
skin_folder
=
self
.
portal
.
portal_skins
[
skin_folder_id
]
skin_folder
=
self
.
portal
.
portal_skins
[
skin_folder_id
]
skin_folder
.
manage_addProduct
[
'PythonScripts'
].
manage_addPythonScript
(
skin_folder
.
manage_addProduct
[
'PythonScripts'
].
manage_addPythonScript
(
id
=
python_script_id
)
id
=
python_script_id
)
...
@@ -6570,7 +6570,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
...
@@ -6570,7 +6570,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
finally
:
finally
:
shutil
.
rmtree
(
export_dir
)
shutil
.
rmtree
(
export_dir
)
new_bt
.
install
(
force
=
0
,
object_to_update
=
{
'dummy_type_provider'
:
'remove'
})
new_bt
.
install
(
force
=
0
,
object_to_update
=
{
'dummy_type_provider'
:
'remove'
})
self
.
assertNotEquals
(
None
,
types_tool
.
getTypeInfo
(
'Base Category'
))
self
.
assertNotEquals
(
None
,
types_tool
.
getTypeInfo
(
'Base Category'
))
self
.
assertNotIn
(
'dummy_type_provider'
,
types_tool
.
type_provider_list
)
self
.
assertNotIn
(
'dummy_type_provider'
,
types_tool
.
type_provider_list
)
...
...
product/ERP5/Document/BusinessTemplate.py
View file @
a87da503
...
@@ -1559,7 +1559,7 @@ class ObjectTemplateItem(BaseTemplateItem):
...
@@ -1559,7 +1559,7 @@ class ObjectTemplateItem(BaseTemplateItem):
if
update_dict
.
has_key
(
widget_path
)
and
update_dict
[
widget_path
]
in
(
'remove'
,
'save_and_remove'
):
if
update_dict
.
has_key
(
widget_path
)
and
update_dict
[
widget_path
]
in
(
'remove'
,
'save_and_remove'
):
continue
continue
widget_in_form
=
0
widget_in_form
=
0
for
group_
id
,
group_value_list
in
new_groups_dict
.
iteritem
s
():
for
group_
value_list
in
new_groups_dict
.
value
s
():
if
widget_id
in
group_value_list
:
if
widget_id
in
group_value_list
:
widget_in_form
=
1
widget_in_form
=
1
break
break
...
@@ -1715,7 +1715,7 @@ class PathTemplateItem(ObjectTemplateItem):
...
@@ -1715,7 +1715,7 @@ class PathTemplateItem(ObjectTemplateItem):
if
len
(
id_list
)
==
0
:
if
len
(
id_list
)
==
0
:
return
[
'/'
.
join
(
relative_url_list
)]
return
[
'/'
.
join
(
relative_url_list
)]
id
=
id_list
[
0
]
id
=
id_list
[
0
]
if
re
.
search
(
'[
\
*
\
?
\
[
\
]]'
,
id
)
is
None
:
if
re
.
search
(
r
'[\
*
\?\
[
\]]'
,
id
)
is
None
:
# If the id has no meta character, do not have to check all objects.
# If the id has no meta character, do not have to check all objects.
obj
=
folder
.
_getOb
(
id
,
None
)
obj
=
folder
.
_getOb
(
id
,
None
)
if
obj
is
None
:
if
obj
is
None
:
...
@@ -1772,7 +1772,7 @@ class PathTemplateItem(ObjectTemplateItem):
...
@@ -1772,7 +1772,7 @@ class PathTemplateItem(ObjectTemplateItem):
# Ignore any object without PortalType (non-ERP5 objects)
# Ignore any object without PortalType (non-ERP5 objects)
try
:
try
:
portal_type
=
aq_base
(
obj
).
getPortalType
()
portal_type
=
aq_base
(
obj
).
getPortalType
()
except
Exception
,
e
:
except
Exception
:
pass
pass
else
:
else
:
if
portal_type
not
in
p
.
portal_types
:
if
portal_type
not
in
p
.
portal_types
:
...
...
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