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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
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):
Get a business template at portal_templates
"""
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
:
return
bt
return
None
...
...
@@ -2640,7 +2640,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
import_bt
=
sequence
.
get
(
'import_bt'
)
pc
=
self
.
getCatalogTool
()
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
)
def
stepCreateNewBusinessTemplate
(
self
,
sequence
=
None
,
**
kw
):
...
...
@@ -2822,7 +2822,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
'template_portal_type_hidden_content_type_list'
,
'template_portal_type_property_sheet_list'
,
'template_portal_type_base_category_list'
):
continue
continue
if
prop_type
==
'text'
or
prop_type
==
'string'
:
prop_dict
[
pid
]
=
''
elif
prop_type
==
'int'
:
...
...
@@ -3141,7 +3141,7 @@ class BusinessTemplateMixin(ERP5TypeTestCase, LogInterceptor):
python_script_id
=
'ERP5Site_dummyScriptWhichRandomId%s'
%
grain_of_sand
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
)
self
.
portal
.
portal_skins
.
manage_addProduct
[
'OFSP'
].
manage_addFolder
(
skin_folder_id
)
skin_folder
=
self
.
portal
.
portal_skins
[
skin_folder_id
]
skin_folder
.
manage_addProduct
[
'PythonScripts'
].
manage_addPythonScript
(
id
=
python_script_id
)
...
...
@@ -6570,7 +6570,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
finally
:
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
.
assertNotIn
(
'dummy_type_provider'
,
types_tool
.
type_provider_list
)
...
...
product/ERP5/Document/BusinessTemplate.py
View file @
a87da503
...
...
@@ -1559,7 +1559,7 @@ class ObjectTemplateItem(BaseTemplateItem):
if
update_dict
.
has_key
(
widget_path
)
and
update_dict
[
widget_path
]
in
(
'remove'
,
'save_and_remove'
):
continue
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
:
widget_in_form
=
1
break
...
...
@@ -1715,7 +1715,7 @@ class PathTemplateItem(ObjectTemplateItem):
if
len
(
id_list
)
==
0
:
return
[
'/'
.
join
(
relative_url_list
)]
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.
obj
=
folder
.
_getOb
(
id
,
None
)
if
obj
is
None
:
...
...
@@ -1772,7 +1772,7 @@ class PathTemplateItem(ObjectTemplateItem):
# Ignore any object without PortalType (non-ERP5 objects)
try
:
portal_type
=
aq_base
(
obj
).
getPortalType
()
except
Exception
,
e
:
except
Exception
:
pass
else
:
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