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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
ea36d7bd
Commit
ea36d7bd
authored
Feb 08, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testTemplateTool: py3
parent
7baa794f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
bt5/erp5_forge/TestTemplateItem/portal_components/test.erp5.testTemplateTool.py
...plateItem/portal_components/test.erp5.testTemplateTool.py
+8
-8
No files found.
bt5/erp5_forge/TestTemplateItem/portal_components/test.erp5.testTemplateTool.py
View file @
ea36d7bd
...
@@ -745,7 +745,7 @@ class TestTemplateTool(ERP5TypeTestCase):
...
@@ -745,7 +745,7 @@ class TestTemplateTool(ERP5TypeTestCase):
bt5list
=
template_tool
.
resolveBusinessTemplateListDependency
((
'erp5_credential'
,))
bt5list
=
template_tool
.
resolveBusinessTemplateListDependency
((
'erp5_credential'
,))
# add some entropy by disorder bt5list returned by
# add some entropy by disorder bt5list returned by
# resolveBusinessTemplateListDependency
# resolveBusinessTemplateListDependency
position_list
=
range
(
len
(
bt5list
))
position_list
=
list
(
range
(
len
(
bt5list
)
))
new_bt5_list
=
[]
new_bt5_list
=
[]
while
position_list
:
while
position_list
:
position
=
random
.
choice
(
position_list
)
position
=
random
.
choice
(
position_list
)
...
@@ -754,10 +754,10 @@ class TestTemplateTool(ERP5TypeTestCase):
...
@@ -754,10 +754,10 @@ class TestTemplateTool(ERP5TypeTestCase):
ordered_list
=
template_tool
.
sortBusinessTemplateList
(
new_bt5_list
)
ordered_list
=
template_tool
.
sortBusinessTemplateList
(
new_bt5_list
)
# group orders
# group orders
first_group
=
range
(
0
,
5
)
first_group
=
list
(
range
(
0
,
5
)
)
second_group
=
range
(
5
,
12
)
second_group
=
list
(
range
(
5
,
12
)
)
third_group
=
range
(
12
,
14
)
third_group
=
list
(
range
(
12
,
14
)
)
fourth_group
=
range
(
14
,
15
)
fourth_group
=
list
(
range
(
14
,
15
)
)
expected_position_dict
=
{
expected_position_dict
=
{
'erp5_property_sheets'
:
first_group
,
'erp5_property_sheets'
:
first_group
,
...
@@ -793,7 +793,7 @@ class TestTemplateTool(ERP5TypeTestCase):
...
@@ -793,7 +793,7 @@ class TestTemplateTool(ERP5TypeTestCase):
bt_dir
=
"%s/%s/bt"
%
(
repository
,
kw
[
'title'
])
bt_dir
=
"%s/%s/bt"
%
(
repository
,
kw
[
'title'
])
if
not
os
.
path
.
exists
(
bt_dir
):
if
not
os
.
path
.
exists
(
bt_dir
):
os
.
makedirs
(
bt_dir
)
os
.
makedirs
(
bt_dir
)
with
open
(
"%s/title"
%
bt_dir
,
"w
b
"
)
as
f
:
with
open
(
"%s/title"
%
bt_dir
,
"w"
)
as
f
:
f
.
write
(
kw
[
'title'
])
f
.
write
(
kw
[
'title'
])
template
=
xml
.
createElement
(
'template'
)
template
=
xml
.
createElement
(
'template'
)
template
.
setAttribute
(
'id'
,
kw
[
'title'
])
template
.
setAttribute
(
'id'
,
kw
[
'title'
])
...
@@ -834,7 +834,7 @@ class TestTemplateTool(ERP5TypeTestCase):
...
@@ -834,7 +834,7 @@ class TestTemplateTool(ERP5TypeTestCase):
createBtAndAddToRepository
(
repository
,
repo_xml
,
title
=
'bt3'
)
createBtAndAddToRepository
(
repository
,
repo_xml
,
title
=
'bt3'
)
createBtAndAddToRepository
(
repository
,
repo_xml
,
title
=
'bt4'
)
createBtAndAddToRepository
(
repository
,
repo_xml
,
title
=
'bt4'
)
createBtAndAddToRepository
(
repository
,
repo_xml
,
title
=
'bt5'
)
createBtAndAddToRepository
(
repository
,
repo_xml
,
title
=
'bt5'
)
with
open
(
"%s/bt5list"
%
repository
,
"wb
"
)
as
repo_xml_fd
:
with
open
(
"%s/bt5list"
%
repository
,
"w
"
)
as
repo_xml_fd
:
repo_xml
.
writexml
(
repo_xml_fd
)
repo_xml
.
writexml
(
repo_xml_fd
)
repo_xml_fd
.
close
()
repo_xml_fd
.
close
()
...
@@ -865,7 +865,7 @@ class TestTemplateTool(ERP5TypeTestCase):
...
@@ -865,7 +865,7 @@ class TestTemplateTool(ERP5TypeTestCase):
erp5_test
=
self
.
portal
.
portal_skins
[
'erp5_test'
]
erp5_test
=
self
.
portal
.
portal_skins
[
'erp5_test'
]
self
.
assertTrue
(
erp5_test
.
hasObject
(
'test_file'
))
self
.
assertTrue
(
erp5_test
.
hasObject
(
'test_file'
))
def
test_owner
hs
ip
(
self
):
def
test_owner
sh
ip
(
self
):
self
.
assertEqual
(
self
.
assertEqual
(
self
.
portal
.
portal_skins
.
erp5_core
.
getOwnerTuple
(),
self
.
portal
.
portal_skins
.
erp5_core
.
getOwnerTuple
(),
([
self
.
portal
.
getId
(),
'acl_users'
],
'System Processes'
),
([
self
.
portal
.
getId
(),
'acl_users'
],
'System Processes'
),
...
...
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