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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aaron Chen
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
Hide 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):
...
@@ -455,10 +455,12 @@ class TestCRM(BaseTestCRM):
mapping_method_id
=
"NotificationMessage_getSubstitutionMappingDictFromEvent"
mapping_method_id
=
"NotificationMessage_getSubstitutionMappingDictFromEvent"
portal
=
self
.
portal
portal
=
self
.
portal
notification_message_reference
=
'campaign-Event.Path'
notification_message_reference
=
'campaign-Event.Path'
service
=
portal
.
service_module
.
newContent
(
portal_type
=
'Service'
)
resource
=
portal
.
notification_message_module
.
newContent
(
resource
=
portal
.
notification_message_module
.
newContent
(
reference
=
notification_message_reference
,
reference
=
notification_message_reference
,
content_type
=
"text/html"
,
content_type
=
"text/html"
,
portal_type
=
"Notification Message"
,
portal_type
=
"Notification Message"
,
specialise_value
=
service
,
text_content_substitution_mapping_method_id
=
mapping_method_id
,
text_content_substitution_mapping_method_id
=
mapping_method_id
,
text_content
=
"Hello ${destination_title}"
)
text_content
=
"Hello ${destination_title}"
)
resource
.
validate
()
resource
.
validate
()
...
@@ -490,7 +492,8 @@ class TestCRM(BaseTestCRM):
...
@@ -490,7 +492,8 @@ class TestCRM(BaseTestCRM):
self
.
tic
()
self
.
tic
()
campaign
.
Ticket_createEventFromDefaultEventPath
()
campaign
.
Ticket_createEventFromDefaultEventPath
()
self
.
tic
()
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
,
[])
self
.
assertEquals
(
event_list
,
[])
event_list
=
campaign
.
getFollowUpRelatedValueList
(
portal_type
=
'Mail Message'
)
event_list
=
campaign
.
getFollowUpRelatedValueList
(
portal_type
=
'Mail Message'
)
self
.
assertNotEquals
(
event_list
,
[])
self
.
assertNotEquals
(
event_list
,
[])
...
@@ -499,6 +502,7 @@ class TestCRM(BaseTestCRM):
...
@@ -499,6 +502,7 @@ class TestCRM(BaseTestCRM):
mail_message
=
event_list
[
0
]
mail_message
=
event_list
[
0
]
self
.
assertEquals
(
sender
.
getRelativeUrl
(),
mail_message
.
getSource
())
self
.
assertEquals
(
sender
.
getRelativeUrl
(),
mail_message
.
getSource
())
self
.
assertEquals
(
mail_message
.
getTextContent
(),
"Hello %s
\
n
"
%
first_user
.
getTitle
())
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"
,
campaign
=
portal
.
campaign_module
.
newContent
(
portal_type
=
"Campaign"
,
default_event_path_event_portal_type
=
"Visit"
,
default_event_path_event_portal_type
=
"Visit"
,
...
@@ -508,13 +512,18 @@ class TestCRM(BaseTestCRM):
...
@@ -508,13 +512,18 @@ class TestCRM(BaseTestCRM):
self
.
tic
()
self
.
tic
()
campaign
.
Ticket_createEventFromDefaultEventPath
()
campaign
.
Ticket_createEventFromDefaultEventPath
()
self
.
tic
()
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
)
self
.
assertEquals
([],
event_list
)
event_list
=
campaign
.
getFollowUpRelatedValueList
(
portal_type
=
'Visit'
)
event_list
=
campaign
.
getFollowUpRelatedValueList
(
portal_type
=
'Visit'
)
self
.
assertNotEquals
([],
event_list
)
self
.
assertNotEquals
([],
event_list
)
destination_uid_list
=
map
(
lambda
x
:
x
.
getDestinationUid
(),
event_list
)
destination_uid_list
=
map
(
lambda
x
:
x
.
getDestinationUid
(),
event_list
)
self
.
assertEquals
([
organisation
.
getUid
()],
destination_uid_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
):
class
TestCRMMailIngestion
(
BaseTestCRM
):
"""Test Mail Ingestion for standalone CRM.
"""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