Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
a4101c17
Commit
a4101c17
authored
Feb 20, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: test: add method in mixin
parent
ff4a11d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
...mponents/test.erp5.testSlapOSERP5VirtualMasterScenario.py
+55
-0
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
View file @
a4101c17
...
...
@@ -7,6 +7,9 @@
from
erp5.component.test.SlapOSTestCaseDefaultScenarioMixin
import
DefaultScenarioMixin
from
Products.ZSQLCatalog.SQLCatalog
import
SimpleQuery
,
NegatedQuery
from
erp5.component.test.SlapOSTestCaseMixin
import
PinnedDateTime
from
DateTime
import
DateTime
class
TestSlapOSVirtualMasterScenarioMixin
(
DefaultScenarioMixin
):
...
...
@@ -248,6 +251,58 @@ class TestSlapOSVirtualMasterScenarioMixin(DefaultScenarioMixin):
related_object_list
.
sort
()
assert
len
(
related_object_list
)
==
count
,
'%i
\
n
%s'
%
(
len
(
related_object_list
),
'
\
n
'
.
join
(
related_object_list
))
def
createProductionManager
(
self
,
project
):
production_manager_reference
=
'production_manager-%s'
%
self
.
generateNewId
()
self
.
joinSlapOS
(
self
.
web_site
,
production_manager_reference
)
self
.
login
()
production_manager_person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"ERP5 Login"
,
reference
=
production_manager_reference
).
getParentValue
()
self
.
addProjectProductionManagerAssignment
(
production_manager_person
,
project
)
self
.
tic
()
return
production_manager_person
def
bootstrapAccountingTest
(
self
):
currency
,
_
,
_
,
sale_person
=
self
.
bootstrapVirtualMasterTest
()
self
.
tic
()
self
.
logout
()
# lets join as slapos administrator, which will manager the project
owner_reference
=
'project-%s'
%
self
.
generateNewId
()
self
.
joinSlapOS
(
self
.
web_site
,
owner_reference
)
self
.
login
()
owner_person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"ERP5 Login"
,
reference
=
owner_reference
).
getParentValue
()
self
.
tic
()
self
.
logout
()
self
.
login
(
sale_person
.
getUserId
())
with
PinnedDateTime
(
self
,
DateTime
(
'2020/01/01'
)):
project_relative_url
=
self
.
addProject
(
is_accountable
=
True
,
person
=
owner_person
,
currency
=
currency
)
self
.
tic
()
self
.
logout
()
self
.
login
()
project
=
self
.
portal
.
restrictedTraverse
(
project_relative_url
)
preference
=
self
.
portal
.
portal_preferences
.
slapos_default_system_preference
preference
.
edit
(
preferred_subscription_assignment_category_list
=
[
'function/customer'
,
'role/client'
,
'destination_project/%s'
%
project
.
getRelativeUrl
()
]
)
return
owner_person
,
currency
,
project
class
TestSlapOSVirtualMasterScenario
(
TestSlapOSVirtualMasterScenarioMixin
):
def
test_virtual_master_without_accounting_scenario
(
self
):
...
...
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