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
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
Léo-Paul Géneau
slapos.core
Commits
e56d66c6
Commit
e56d66c6
authored
Sep 06, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: fix tests on ticket event and getRSSTextContent
parent
bec6418b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
71 deletions
+82
-71
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+82
-71
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
e56d66c6
...
...
@@ -157,21 +157,98 @@ class TestSlapOSFolder_getOpenTicketList(testSlapOSMixin):
ticket
=
newUpgradeDecision
()
self
.
_test_upgrade_decision
(
ticket
,
2
)
class
TestSlapOSEvent_getRSSTextContent
(
testSlapOSMixin
):
class
TestSlapOSTicketEvent
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
transaction
.
abort
()
def
test_Event_getRSSTextContent
(
self
):
def
afterSetUp
(
self
):
super
(
TestSlapOSTicketEvent
,
self
).
afterSetUp
()
def
_test_event
(
self
,
ticket
):
def
newEvent
(
ticket
):
event
=
self
.
portal
.
event_module
.
newContent
(
title
=
"Test Event %s"
%
self
.
new_id
,
portal_type
=
"Web Message"
,
follow_up_value
=
ticket
)
event
.
immediateReindexObject
()
return
event
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
None
)
event
=
newEvent
(
ticket
)
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
None
)
event
.
plan
()
event
.
immediateReindexObject
()
self
.
assertEquals
(
last_event
,
None
)
event
.
confirm
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
event
.
start
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
event
.
stop
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
event
.
deliver
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
# Now we test unwanted cases (deleted and cancelled)
another_event
=
newEvent
(
ticket
)
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
another_event
.
cancel
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
another_event
=
newEvent
(
ticket
)
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
another_event
.
delete
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
class
TestSlapOSEvent_getRSSTextContent
(
TestSlapOSTicketEvent
):
def
afterSetUp
(
self
):
super
(
TestSlapOSEvent_getRSSTextContent
,
self
).
afterSetUp
()
self
.
new_id
=
self
.
generateNewId
()
s
ource
=
self
.
portal
.
person_module
.
newContent
(
s
elf
.
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
"Person %s"
%
self
.
new_id
,
reference
=
"TESTPERS-%s"
%
self
.
new_id
,
default_email_text
=
"live_test_%s@example.org"
%
self
.
new_id
,
)
def
beforeTearDown
(
self
):
transaction
.
abort
()
def
test_Event_getRSSTextContent
(
self
):
source
=
self
.
person
destination
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
"Person Destination %s"
%
self
.
new_id
,
...
...
@@ -234,7 +311,7 @@ class TestSlapOSEvent_getRSSTextContent(testSlapOSMixin):
self
.
_test_event
(
ticket
)
class
TestSlapOSTicket_getLatestEvent
(
testSlapOSMixin
):
class
TestSlapOSTicket_getLatestEvent
(
TestSlapOSTicketEvent
):
def
beforeTearDown
(
self
):
transaction
.
abort
()
...
...
@@ -249,72 +326,6 @@ class TestSlapOSTicket_getLatestEvent(testSlapOSMixin):
default_email_text
=
"live_test_%s@example.org"
%
self
.
new_id
,
)
def
_test_event
(
self
,
ticket
):
def
newEvent
(
ticket
):
event
=
self
.
portal
.
event_module
.
newContent
(
title
=
"Test Event %s"
%
self
.
new_id
,
portal_type
=
"Web Message"
,
follow_up_value
=
ticket
)
event
.
immediateReindexObject
()
return
event
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
None
)
event
=
newEvent
(
ticket
)
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
None
)
event
.
plan
()
event
.
immediateReindexObject
()
self
.
assertEquals
(
last_event
,
None
)
event
.
confirm
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
event
.
start
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
event
.
stop
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
event
.
deliver
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
# Now we test unwanted cases (deleted and cancelled)
another_event
=
newEvent
(
ticket
)
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
another_event
.
cancel
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
another_event
=
newEvent
(
ticket
)
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
another_event
.
delete
()
event
.
immediateReindexObject
()
last_event
=
ticket
.
Ticket_getLatestEvent
()
self
.
assertEquals
(
last_event
,
event
)
def
test_support_request
(
self
):
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
\
title
=
"Test Support Request %s"
%
self
.
new_id
,
...
...
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