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
07cd9772
Commit
07cd9772
authored
Jun 18, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: more test
parent
d96a09d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+62
-0
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
07cd9772
...
...
@@ -517,6 +517,37 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertEquals
(
event
.
getSimulationState
(),
'stopped'
)
def
test_Ticket_createProjectEvent_incomingEventWithSourceAndDestination
(
self
):
ticket
=
self
.
createUsualTicket
()
source_value
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
'custom source person'
)
destination_value
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
'custom destination person'
)
event
=
ticket
.
Ticket_createProjectEvent
(
'foo_title'
,
'incoming'
,
'Letter'
,
'foo resource'
,
'foo text'
,
source
=
source_value
.
getRelativeUrl
(),
destination
=
destination_value
.
getRelativeUrl
()
)
self
.
assertEquals
(
event
.
getPortalType
(),
'Letter'
)
self
.
assertEquals
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEquals
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEquals
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEquals
(
event
.
getSource
(),
source_value
.
getRelativeUrl
())
self
.
assertEquals
(
event
.
getSourceSection
(),
ticket
.
getDestinationSection
())
self
.
assertEquals
(
event
.
getSourceProject
(),
ticket
.
getDestinationProject
())
self
.
assertEquals
(
event
.
getDestination
(),
destination_value
.
getRelativeUrl
())
self
.
assertEquals
(
event
.
getDestinationSection
(),
ticket
.
getSourceSection
())
self
.
assertEquals
(
event
.
getDestinationProject
(),
ticket
.
getSourceProject
())
self
.
assertEquals
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEquals
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertEquals
(
event
.
getSimulationState
(),
'stopped'
)
def
test_Ticket_createProjectEvent_incomingEventWithAttachment
(
self
):
ticket
=
self
.
createUsualTicket
()
event
=
ticket
.
Ticket_createProjectEvent
(
...
...
@@ -564,3 +595,34 @@ class TestTicket_createProjectEvent(TestCRMSkinsMixin):
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertEquals
(
event
.
getSimulationState
(),
'delivered'
)
def
test_Ticket_createProjectEvent_outgoingEventWithSourceAndDestination
(
self
):
ticket
=
self
.
createUsualTicket
()
source_value
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
'custom source person'
)
destination_value
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
'custom destination person'
)
event
=
ticket
.
Ticket_createProjectEvent
(
'foo_title'
,
'outgoing'
,
'Web Message'
,
'foo resource'
,
'foo text'
,
source
=
source_value
.
getRelativeUrl
(),
destination
=
destination_value
.
getRelativeUrl
()
)
self
.
assertEquals
(
event
.
getPortalType
(),
'Web Message'
)
self
.
assertEquals
(
event
.
getTitle
(),
'foo_title'
)
self
.
assertEquals
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEquals
(
event
.
getResource
(),
'foo resource'
)
self
.
assertEquals
(
event
.
getDestination
(),
destination_value
.
getRelativeUrl
())
self
.
assertEquals
(
event
.
getDestinationSection
(),
ticket
.
getDestinationSection
())
self
.
assertEquals
(
event
.
getDestinationProject
(),
ticket
.
getDestinationProject
())
self
.
assertEquals
(
event
.
getSource
(),
source_value
.
getRelativeUrl
())
self
.
assertEquals
(
event
.
getSourceSection
(),
ticket
.
getSourceSection
())
self
.
assertEquals
(
event
.
getSourceProject
(),
ticket
.
getSourceProject
())
self
.
assertEquals
(
event
.
getTextContent
(),
'foo text'
)
self
.
assertEquals
(
event
.
getContentType
(),
'text/plain'
)
self
.
assertSameEventAttachmentList
(
event
)
self
.
assertEquals
(
event
.
getSimulationState
(),
'delivered'
)
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