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
493e95b4
Commit
493e95b4
authored
Feb 20, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: test: move to mixin
parent
caf4c9cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
51 deletions
+1
-51
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5AccountingScenario.py
..._components/test.erp5.testSlapOSERP5AccountingScenario.py
+1
-51
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5AccountingScenario.py
View file @
493e95b4
...
@@ -12,56 +12,18 @@ from DateTime import DateTime
...
@@ -12,56 +12,18 @@ from DateTime import DateTime
class
TestSlapOSAccountingScenario
(
TestSlapOSVirtualMasterScenarioMixin
):
class
TestSlapOSAccountingScenario
(
TestSlapOSVirtualMasterScenarioMixin
):
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
def
test_rejectedSubscriptionScenario
(
self
):
def
test_rejectedSubscriptionScenario
(
self
):
"""
"""
User does not pay the subscription, which is cancelled after some time
User does not pay the subscription, which is cancelled after some time
"""
"""
_
,
_
,
project
=
self
.
bootstrapAccountingTest
()
_
,
_
,
project
=
self
.
bootstrapAccountingTest
()
self
.
assertEqual
(
project
.
getValidationState
(),
"invalidated"
)
subscription_request
=
self
.
portal
.
portal_catalog
.
getResultValue
(
subscription_request
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Subscription Request"
,
portal_type
=
"Subscription Request"
,
aggregate__uid
=
project
.
getUid
()
aggregate__uid
=
project
.
getUid
()
)
)
self
.
assertEqual
(
subscription_request
.
getSimulationState
(),
"cancelled"
)
self
.
assertEqual
(
subscription_request
.
getSimulationState
(),
"cancelled"
)
self
.
assertEqual
(
project
.
getValidationState
(),
"invalidated"
)
# Ensure no unexpected object has been created
# Ensure no unexpected object has been created
# 2 assignment
# 2 assignment
...
@@ -210,18 +172,6 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -210,18 +172,6 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
with
PinnedDateTime
(
self
,
DateTime
(
'2021/07/06'
)):
with
PinnedDateTime
(
self
,
DateTime
(
'2021/07/06'
)):
self
.
checkERP5StateBeforeExit
()
self
.
checkERP5StateBeforeExit
()
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
test_aggregationOfMonthlyInvoiceScenario
(
self
):
def
test_aggregationOfMonthlyInvoiceScenario
(
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