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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
94f882e9
Commit
94f882e9
authored
Jan 21, 2022
by
Rafael Monnerat
👻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Added test for ticket_slap_interface_workflow
parent
9fe3084b
Pipeline
#19426
failed with stage
in 0 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
233 additions
and
2 deletions
+233
-2
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudTicketSlapInterfaceWorkflow.py
...s/test.erp5.testSlapOSCloudTicketSlapInterfaceWorkflow.py
+97
-0
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudTicketSlapInterfaceWorkflow.xml
.../test.erp5.testSlapOSCloudTicketSlapInterfaceWorkflow.xml
+133
-0
master/bt5/slapos_crm/WorkflowTemplateItem/portal_workflow/ticket_slap_interface_workflow/script_Ticket_approveRegistration.py
...p_interface_workflow/script_Ticket_approveRegistration.py
+1
-1
master/bt5/slapos_crm/bt/template_test_id_list
master/bt5/slapos_crm/bt/template_test_id_list
+2
-1
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudTicketSlapInterfaceWorkflow.py
0 → 100644
View file @
94f882e9
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2002-2012 Nexedi SA and Contributors. All Rights Reserved.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
erp5.component.test.SlapOSTestCaseMixin
import
SlapOSTestCaseMixin
#, simulate
#from zExceptions import Unauthorized
import
transaction
class
TestSlapOSCoreTicketSlapInterfaceWorkflow
(
SlapOSTestCaseMixin
):
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
portal
=
self
.
getPortalObject
()
self
.
ticket_trade_condition
=
portal
.
sale_trade_condition_module
.
slapos_ticket_trade_condition
person_user
=
self
.
makePerson
()
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
getUserId
())
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
self
.
support_request
=
portal
.
support_request_module
.
newContent
(
portal_type
=
"Support Request"
,
destination_decision
=
person_user
.
getRelativeUrl
(),
specialise
=
self
.
ticket_trade_condition
.
getRelativeUrl
()
)
# Value set by the init
self
.
assertTrue
(
self
.
support_request
.
getReference
().
startswith
(
"SR-"
),
"Reference don't start with SR- : %s"
%
self
.
support_request
.
getReference
())
def
beforeTearDown
(
self
):
transaction
.
abort
()
def
test_SupportRequest_approveRegistration_no_reference
(
self
):
self
.
support_request
.
setReference
(
None
)
self
.
assertRaises
(
ValueError
,
self
.
support_request
.
approveRegistration
)
def
test_SupportRequest_approveRegistration_already_validated
(
self
):
# Login as admin since user cannot re-approve a validated project
self
.
login
()
self
.
support_request
.
validate
()
# Don't raise if project is validated
self
.
assertEqual
(
self
.
support_request
.
approveRegistration
(),
None
)
def
test_SupportRequest_approveRegistration
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
support_request
.
approveRegistration
()
self
.
tic
()
self
.
logout
()
self
.
login
(
person
.
getUserId
())
self
.
assertEqual
(
self
.
support_request
.
getSimulationState
(),
'validated'
)
self
.
assertEqual
(
self
.
support_request
.
getSourceSection
(),
self
.
ticket_trade_condition
.
getSourceSection
())
self
.
assertEqual
(
self
.
support_request
.
getSourceTrade
(),
self
.
ticket_trade_condition
.
getSourceSection
())
self
.
assertEqual
(
self
.
support_request
.
getSource
(),
self
.
ticket_trade_condition
.
getSource
())
self
.
assertNotEqual
(
self
.
support_request
.
getStartDate
(),
None
)
event
=
self
.
support_request
.
getCausalityValue
()
self
.
assertNotEqual
(
event
,
None
)
event_relative_url
=
self
.
support_request
.
REQUEST
.
get
(
"event_relative_url"
)
self
.
assertEqual
(
event
.
getRelativeUrl
(),
event_relative_url
)
self
.
assertEqual
(
event
.
getTitle
(),
self
.
support_request
.
getTitle
())
\ No newline at end of file
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudTicketSlapInterfaceWorkflow.xml
0 → 100644
View file @
94f882e9
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSCloudTicketSlapInterfaceWorkflow
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testSlapOSCloudTicketSlapInterfaceWorkflow
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/WorkflowTemplateItem/portal_workflow/ticket_slap_interface_workflow/script_Ticket_approveRegistration.py
View file @
94f882e9
...
@@ -7,7 +7,7 @@ if ticket.getSimulationState() != "draft":
...
@@ -7,7 +7,7 @@ if ticket.getSimulationState() != "draft":
return
return
if
ticket
.
getReference
()
in
[
None
,
""
]:
if
ticket
.
getReference
()
in
[
None
,
""
]:
raise
ValueError
(
"Reference is missing on the
Projec
t"
)
raise
ValueError
(
"Reference is missing on the
Ticke
t"
)
# Get the user id of the context owner.
# Get the user id of the context owner.
local_role_list
=
ticket
.
get_local_roles
()
local_role_list
=
ticket
.
get_local_roles
()
...
...
master/bt5/slapos_crm/bt/template_test_id_list
View file @
94f882e9
test.erp5.testSlapOSCRMSkins
test.erp5.testSlapOSCRMSkins
test.erp5.testSlapOSCRMRegularisationRequestSkins
test.erp5.testSlapOSCRMRegularisationRequestSkins
test.erp5.testSlapOSCRMAlarm
test.erp5.testSlapOSCRMAlarm
\ No newline at end of file
test.erp5.testSlapOSCloudTicketSlapInterfaceWorkflow
\ No newline at end of file
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