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
Labels
Merge Requests
18
Merge Requests
18
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
nexedi
slapos.core
Commits
c7d05323
Commit
c7d05323
authored
Nov 13, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_panel: Test Ticket_[close|validate|suspend]SlapOS scripts
parent
db92c85b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
2 deletions
+135
-2
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
...Item/portal_components/test.erp5.testSlapOSCodingStyle.py
+0
-2
master/bt5/slapos_panel/TestTemplateItem/portal_components/test.erp5.testSlapOSPanelSkins.py
...eItem/portal_components/test.erp5.testSlapOSPanelSkins.py
+135
-0
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
View file @
c7d05323
...
@@ -266,8 +266,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
...
@@ -266,8 +266,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_panel/SubscriptionRequest_changeSlaposSubmittedPrice'
,
'slapos_panel/SubscriptionRequest_changeSlaposSubmittedPrice'
,
'slapos_panel/SubscriptionRequest_jumpToPaymentPage'
,
'slapos_panel/SubscriptionRequest_jumpToPaymentPage'
,
'slapos_panel/Ticket_addSlapOSEvent'
,
'slapos_panel/Ticket_addSlapOSEvent'
,
'slapos_panel/Ticket_closeSlapOS'
,
'slapos_panel/Ticket_suspendSlapOS'
,
'slapos_panel/AccountingTransactionModule_getCreateExternalPaymentTransactionList'
,
'slapos_panel/AccountingTransactionModule_getCreateExternalPaymentTransactionList'
,
'slapos_panel/AccountingTransactionModule_testCreateExternalPaymentTransactionPending'
,
'slapos_panel/AccountingTransactionModule_testCreateExternalPaymentTransactionPending'
,
'slapos_panel/Base_getExternalPaymentTransactionUrl'
,
'slapos_panel/Base_getExternalPaymentTransactionUrl'
,
...
...
master/bt5/slapos_panel/TestTemplateItem/portal_components/test.erp5.testSlapOSPanelSkins.py
View file @
c7d05323
...
@@ -330,3 +330,138 @@ class TestBase_hasSlapOSAccountingUserGroup(TestPanelSkinsMixin):
...
@@ -330,3 +330,138 @@ class TestBase_hasSlapOSAccountingUserGroup(TestPanelSkinsMixin):
agent
=
True
))
agent
=
True
))
self
.
assertTrue
(
regularisation_request
.
Base_hasSlapOSAccountingUserGroup
(
self
.
assertTrue
(
regularisation_request
.
Base_hasSlapOSAccountingUserGroup
(
manager
=
True
,
agent
=
True
))
manager
=
True
,
agent
=
True
))
class
TestTicket_validateSlapOS
(
TestPanelSkinsMixin
):
def
_makePersonAndTicket
(
self
,
portal_type
):
person
=
self
.
makePerson
(
self
.
project
,
user
=
1
)
ticket
=
self
.
portal
.
getDefaultModule
(
portal_type
).
newContent
(
portal_type
=
portal_type
,
title
=
'TESTICKET-%s'
%
self
.
generateNewId
(),
destination_decision_value
=
person
)
return
person
,
ticket
def
test_Ticket_validateSlapOS_regularisation_request
(
self
):
person
,
ticket
=
self
.
_makePersonAndTicket
(
'Regularisation Request'
)
ticket
.
submit
()
self
.
addAccountingManagerAssignment
(
person
)
self
.
tic
()
self
.
login
(
person
.
getUserId
())
ticket
.
Ticket_validateSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'submitted'
)
ticket
.
validate
()
ticket
.
suspend
()
ticket
.
Ticket_validateSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'validated'
)
ticket
.
Ticket_validateSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'validated'
)
ticket
.
invalidate
()
ticket
.
Ticket_validateSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'invalidated'
)
def
test_Ticket_validateSlapOS_support_request
(
self
):
person
,
ticket
=
self
.
_makePersonAndTicket
(
'Support Request'
)
ticket
.
edit
(
source_project_value
=
self
.
project
,
destination_project_value
=
self
.
project
)
ticket
.
submit
()
self
.
addProjectProductionManagerAssignment
(
person
,
self
.
project
)
self
.
tic
()
self
.
login
(
person
.
getUserId
())
# Cheat to call the script wont change the value.
ticket
.
Ticket_validateSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'submitted'
)
ticket
.
validate
()
ticket
.
suspend
()
self
.
login
(
person
.
getUserId
())
ticket
.
Ticket_validateSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'suspended'
)
ticket
.
validate
()
ticket
.
Ticket_validateSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'validated'
)
ticket
.
invalidate
()
ticket
.
Ticket_validateSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'invalidated'
)
class
TestTicket_suspendSlapOS
(
TestPanelSkinsMixin
):
def
_makePersonAndTicket
(
self
,
portal_type
):
person
=
self
.
makePerson
(
self
.
project
,
user
=
1
)
ticket
=
self
.
portal
.
getDefaultModule
(
portal_type
).
newContent
(
portal_type
=
portal_type
,
title
=
'TESTICKET-%s'
%
self
.
generateNewId
(),
destination_decision_value
=
person
)
return
person
,
ticket
def
test_Ticket_suspendSlapOS_regularisation_request
(
self
):
person
,
ticket
=
self
.
_makePersonAndTicket
(
'Regularisation Request'
)
ticket
.
submit
()
self
.
addAccountingManagerAssignment
(
person
)
self
.
tic
()
self
.
login
(
person
.
getUserId
())
ticket
.
Ticket_suspendSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'submitted'
)
ticket
.
validate
()
ticket
.
Ticket_suspendSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'suspended'
)
ticket
.
Ticket_suspendSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'suspended'
)
ticket
.
validate
()
ticket
.
invalidate
()
ticket
.
Ticket_suspendSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'invalidated'
)
def
test_Ticket_suspendSlapOS_support_request
(
self
):
person
,
ticket
=
self
.
_makePersonAndTicket
(
'Support Request'
)
ticket
.
edit
(
source_project_value
=
self
.
project
,
destination_project_value
=
self
.
project
)
ticket
.
submit
()
self
.
addProjectProductionManagerAssignment
(
person
,
self
.
project
)
self
.
tic
()
self
.
login
(
person
.
getUserId
())
ticket
.
Ticket_suspendSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'submitted'
)
ticket
.
validate
()
ticket
.
Ticket_suspendSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'suspended'
)
ticket
.
Ticket_suspendSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'suspended'
)
ticket
.
validate
()
ticket
.
invalidate
()
ticket
.
Ticket_suspendSlapOS
()
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'invalidated'
)
class
TestTicket_closeSlapOS
(
TestPanelSkinsMixin
):
def
_makePersonAndTicket
(
self
,
portal_type
):
person
=
self
.
makePerson
(
self
.
project
,
user
=
1
)
ticket
=
self
.
portal
.
getDefaultModule
(
portal_type
).
newContent
(
portal_type
=
portal_type
,
title
=
'TESTICKET-%s'
%
self
.
generateNewId
(),
destination_decision_value
=
person
)
return
person
,
ticket
def
test_Ticket_closeSlapOS_support_request
(
self
):
person
,
ticket
=
self
.
_makePersonAndTicket
(
'Support Request'
)
ticket
.
edit
(
source_project_value
=
self
.
project
,
destination_project_value
=
self
.
project
)
ticket
.
submit
()
self
.
addProjectProductionManagerAssignment
(
person
,
self
.
project
)
self
.
tic
()
self
.
login
(
person
.
getUserId
())
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'submitted'
)
ticket
.
validate
()
ticket
.
Ticket_closeSlapOS
(
"x"
)
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'invalidated'
)
ticket
.
validate
()
ticket
.
suspend
()
ticket
.
Ticket_closeSlapOS
(
"x"
)
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'invalidated'
)
ticket
.
Ticket_closeSlapOS
(
"x"
)
self
.
assertEqual
(
ticket
.
getSimulationState
(),
'invalidated'
)
\ No newline at end of file
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