Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
0
Merge Requests
0
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
Laurent S
erp5
Commits
c71df6a0
Commit
c71df6a0
authored
May 20, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event path: check the resource of created events
parent
efddc268
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
product/ERP5/tests/testCRM.py
product/ERP5/tests/testCRM.py
+11
-2
No files found.
product/ERP5/tests/testCRM.py
View file @
c71df6a0
...
...
@@ -455,10 +455,12 @@ class TestCRM(BaseTestCRM):
mapping_method_id
=
"NotificationMessage_getSubstitutionMappingDictFromEvent"
portal
=
self
.
portal
notification_message_reference
=
'campaign-Event.Path'
service
=
portal
.
service_module
.
newContent
(
portal_type
=
'Service'
)
resource
=
portal
.
notification_message_module
.
newContent
(
reference
=
notification_message_reference
,
content_type
=
"text/html"
,
portal_type
=
"Notification Message"
,
specialise_value
=
service
,
text_content_substitution_mapping_method_id
=
mapping_method_id
,
text_content
=
"Hello ${destination_title}"
)
resource
.
validate
()
...
...
@@ -490,7 +492,8 @@ class TestCRM(BaseTestCRM):
self
.
tic
()
campaign
.
Ticket_createEventFromDefaultEventPath
()
self
.
tic
()
event_list
=
campaign
.
getFollowUpRelatedValueList
(
portal_type
=
'NOT Mail Message'
)
event_list
=
[
event
for
event
in
campaign
.
getFollowUpRelatedValueList
()
if
event
.
getPortalType
()
!=
'Mail Message'
]
self
.
assertEquals
(
event_list
,
[])
event_list
=
campaign
.
getFollowUpRelatedValueList
(
portal_type
=
'Mail Message'
)
self
.
assertNotEquals
(
event_list
,
[])
...
...
@@ -499,6 +502,7 @@ class TestCRM(BaseTestCRM):
mail_message
=
event_list
[
0
]
self
.
assertEquals
(
sender
.
getRelativeUrl
(),
mail_message
.
getSource
())
self
.
assertEquals
(
mail_message
.
getTextContent
(),
"Hello %s
\
n
"
%
first_user
.
getTitle
())
self
.
assertEquals
(
mail_message
.
getResourceValue
(),
service
)
campaign
=
portal
.
campaign_module
.
newContent
(
portal_type
=
"Campaign"
,
default_event_path_event_portal_type
=
"Visit"
,
...
...
@@ -508,13 +512,18 @@ class TestCRM(BaseTestCRM):
self
.
tic
()
campaign
.
Ticket_createEventFromDefaultEventPath
()
self
.
tic
()
event_list
=
campaign
.
getFollowUpRelatedValueList
(
portal_type
=
'NOT Visit'
)
event_list
=
[
event
for
event
in
campaign
.
getFollowUpRelatedValueList
()
if
event
.
getPortalType
()
!=
'Visit'
]
self
.
assertEquals
([],
event_list
)
event_list
=
campaign
.
getFollowUpRelatedValueList
(
portal_type
=
'Visit'
)
self
.
assertNotEquals
([],
event_list
)
destination_uid_list
=
map
(
lambda
x
:
x
.
getDestinationUid
(),
event_list
)
self
.
assertEquals
([
organisation
.
getUid
()],
destination_uid_list
)
resource_value_list
=
map
(
lambda
x
:
x
.
getResourceValue
(),
event_list
)
self
.
assertEquals
([
service
],
resource_value_list
)
class
TestCRMMailIngestion
(
BaseTestCRM
):
"""Test Mail Ingestion for standalone CRM.
"""
...
...
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