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
731299cf
Commit
731299cf
authored
Aug 21, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: More tests
parent
8ca0f757
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
32 deletions
+58
-32
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+58
-32
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
731299cf
...
@@ -216,76 +216,96 @@ class TestSlapOSFolder_getOpenTicketList(TestCRMSkinsMixin):
...
@@ -216,76 +216,96 @@ class TestSlapOSFolder_getOpenTicketList(TestCRMSkinsMixin):
class
TestSlapOSBase_getOpenRelatedTicketList
(
TestCRMSkinsMixin
):
class
TestSlapOSBase_getOpenRelatedTicketList
(
TestCRMSkinsMixin
):
def
test_support_request_related_to_computer
(
self
):
def
test_getOpenRelatedTicketList_support_request_related_to_computer
(
self
):
computer
=
self
.
_makeComputer
()[
0
]
self
.
_test_getOpenRelatedTicketList_support_request_related
(
self
.
_makeComputer
()[
0
])
def
test_getOpenRelatedTicketList_support_request_related_to_hosting_subscription
(
self
):
self
.
_test_getOpenRelatedTicketList_support_request_related
(
self
.
_makeHostingSubscription
())
def
_test_getOpenRelatedTicketList_support_request_related
(
self
,
document
):
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
\
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
\
title
=
"Test Support Request %s"
%
self
.
new_id
)
title
=
"Test Support Request %s"
%
self
.
new_id
)
ticket
.
setAggregateValue
(
computer
)
ticket
.
setAggregateValue
(
document
)
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
# Not indexed yet
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
self
.
tic
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
submit
()
ticket
.
submit
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
validate
()
ticket
.
validate
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
suspend
()
ticket
.
suspend
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
invalidate
()
ticket
.
invalidate
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
def
test_cancelled_support_request_related_to_computer
(
self
):
def
test_getOpenRelatedTicketList_cancelled_support_request_related_to_computer
(
self
):
computer
=
self
.
_makeComputer
()[
0
]
self
.
_test_getOpenRelatedTicketList_cancelled_support_request_related
(
self
.
_makeComputer
()[
0
])
def
test_getOpenRelatedTicketList_cancelled_support_request_related_to_hosting_subscription
(
self
):
self
.
_test_getOpenRelatedTicketList_cancelled_support_request_related
(
self
.
_makeHostingSubscription
())
def
_test_getOpenRelatedTicketList_cancelled_support_request_related
(
self
,
document
):
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
\
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
\
title
=
"Test Support Request %s"
%
self
.
new_id
)
title
=
"Test Support Request %s"
%
self
.
new_id
)
ticket
.
setAggregateValue
(
computer
)
ticket
.
setAggregateValue
(
document
)
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
# Not indexed yet
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
self
.
tic
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
submit
()
ticket
.
submit
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
cancel
()
ticket
.
cancel
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
def
test_upgrade_decision_related_to_computer
(
self
):
def
test_getOpenRelatedTicketList_upgrade_decision_related_to_computer
(
self
):
computer
=
self
.
_makeComputer
()[
0
]
self
.
_test_getOpenRelatedTicketList_upgrade_decision_related
(
self
.
_makeComputer
()[
0
])
def
test_getOpenRelatedTicketList_upgrade_decision_related_to_hosting_subscription
(
self
):
self
.
_test_getOpenRelatedTicketList_upgrade_decision_related
(
self
.
_makeHostingSubscription
())
def
_test_getOpenRelatedTicketList_upgrade_decision_related
(
self
,
document
):
def
newUpgradeDecision
():
def
newUpgradeDecision
():
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
portal_type
=
'Upgrade Decision'
,
portal_type
=
'Upgrade Decision'
,
...
@@ -298,50 +318,56 @@ class TestSlapOSBase_getOpenRelatedTicketList(TestCRMSkinsMixin):
...
@@ -298,50 +318,56 @@ class TestSlapOSBase_getOpenRelatedTicketList(TestCRMSkinsMixin):
ticket
.
newContent
(
ticket
.
newContent
(
portal_type
=
"Upgrade Decision Line"
portal_type
=
"Upgrade Decision Line"
).
setAggregateValue
(
computer
)
).
setAggregateValue
(
document
)
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
# Not indexed yet
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
self
.
tic
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
plan
()
ticket
.
plan
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
confirm
()
ticket
.
confirm
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
start
()
ticket
.
start
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
stop
()
ticket
.
stop
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
deliver
()
ticket
.
deliver
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
def
test_getOpenRelatedTicketList_cancelled_upgrade_decision_related_to_computer
(
self
):
self
.
_test_getOpenRelatedTicketList_cancelled_upgrade_decision_related
(
self
.
_makeComputer
()[
0
])
def
test_getOpenRelatedTicketList_cancelled_upgrade_decision_related_to_hosting_subscription
(
self
):
self
.
_test_getOpenRelatedTicketList_cancelled_upgrade_decision_related
(
self
.
_makeHostingSubscription
())
def
test_cancelled_upgrade_decision_related_to_computer
(
self
):
def
_test_getOpenRelatedTicketList_cancelled_upgrade_decision_related
(
self
,
document
):
computer
=
self
.
_makeComputer
()[
0
]
def
newUpgradeDecision
():
def
newUpgradeDecision
():
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
portal_type
=
'Upgrade Decision'
,
portal_type
=
'Upgrade Decision'
,
...
@@ -354,20 +380,20 @@ class TestSlapOSBase_getOpenRelatedTicketList(TestCRMSkinsMixin):
...
@@ -354,20 +380,20 @@ class TestSlapOSBase_getOpenRelatedTicketList(TestCRMSkinsMixin):
ticket
.
newContent
(
ticket
.
newContent
(
portal_type
=
"Upgrade Decision Line"
portal_type
=
"Upgrade Decision Line"
).
setAggregateValue
(
computer
)
).
setAggregateValue
(
document
)
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
# Not indexed yet
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
self
.
tic
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
cancel
()
ticket
.
cancel
()
ticket
.
immediateReindexObject
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
computer
.
Base_getOpenRelatedTicketList
()
open_related_ticket_list
=
document
.
Base_getOpenRelatedTicketList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
class
TestSlapOSTicketEvent
(
TestCRMSkinsMixin
):
class
TestSlapOSTicketEvent
(
TestCRMSkinsMixin
):
...
...
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