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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Papa Tamsir Kane
erp5
Commits
159bb6f1
Commit
159bb6f1
authored
Sep 05, 2017
by
Papa Tamsir Kane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_curation_request: Remove test from bt5
parent
7d1e22e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
268 deletions
+0
-268
bt5/erp5_curation_request/TestTemplateItem/portal_components/test.erp5.testCurationRequest.py
...teItem/portal_components/test.erp5.testCurationRequest.py
+0
-144
bt5/erp5_curation_request/TestTemplateItem/portal_components/test.erp5.testCurationRequest.xml
...eItem/portal_components/test.erp5.testCurationRequest.xml
+0
-123
bt5/erp5_curation_request/bt/template_test_id_list
bt5/erp5_curation_request/bt/template_test_id_list
+0
-1
No files found.
bt5/erp5_curation_request/TestTemplateItem/portal_components/test.erp5.testCurationRequest.py
deleted
100644 → 0
View file @
7d1e22e8
##############################################################################
#
# Copyright (c) 2002-2017 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
class
TestCurationRequest
(
ERP5TypeTestCase
):
"""
Test Curation Request
"""
objects_to_delete
=
[]
def
getTitle
(
self
):
return
"testCurationRequest"
def
getBusinessTemplateList
(
self
):
"""
Tuple of Business Templates we need to install
"""
return
(
'erp5_base'
,)
def
afterSetUp
(
self
):
self
.
curation_request_module
=
self
.
portal
.
getDefaultModule
(
portal_type
=
'Curation Request'
)
self
.
assertTrue
(
self
.
curation_request_module
is
not
None
)
def
beforeTearDown
(
self
):
portal
=
self
.
portal
# delete objects creared by the tests
for
path
in
self
.
objects_to_delete
:
created_object
=
portal
.
unrestrictedTraverse
(
path
,
None
)
if
created_object
is
None
:
continue
created_object_id
=
created_object
.
getId
()
created_object_parent
=
created_object
.
getParentValue
()
created_object_parent
.
_delObject
(
created_object_id
)
# Unindex deleted objects
self
.
tic
()
def
_new_curation_request
(
self
,
objects_to_delete
,
title
=
''
,
business_process
=
None
,):
if
business_process
is
None
:
business_process
=
self
.
portal
.
portal_catalog
(
portal_type
=
"Business Process"
,
id
=
"curation_request_business_process"
)[
0
]
cr
=
self
.
curation_request_module
.
newContent
(
portal_type
=
'Curation Request'
,
title
=
title
,
#specialise = business_process
)
cr
.
setSpecialiseValue
(
business_process
)
objects_to_delete
.
append
(
cr
.
getPath
())
return
cr
def
_get_curation_request_lines_and_schedule_deletion
(
self
,
curation_request
,
objects_to_delete
):
lines
=
curation_request
.
contentValues
(
portal_type
=
'Curation Request Line'
)
objects_to_delete
.
extend
([
line
.
getAggregateValue
().
getPath
()
for
line
in
lines
])
return
lines
def
_get_decisions_and_schedule_deletion
(
self
,
curation_request
,
objects_to_delete
):
decisions
=
curation_request
.
getCausalityRelatedValueList
(
portal_type
=
'Decision'
)
objects_to_delete
.
extend
([
decision
.
getPath
()
for
decision
in
decisions
])
return
decisions
def
test_01_one_curation_record_is_created_for_new_curation_request
(
self
):
self
.
login
()
curation_request
=
self
.
_new_curation_request
(
self
.
objects_to_delete
,
title
=
'test cr 1'
)
lines
=
self
.
_get_curation_request_lines_and_schedule_deletion
(
curation_request
,
self
.
objects_to_delete
)
self
.
assertEqual
(
len
(
lines
),
1
)
self
.
assertEqual
(
lines
[
0
].
getAggregateValue
().
getPortalType
(),
'Curation Record'
)
def
test_02_create_decision_by_business_process
(
self
):
self
.
login
()
curation_request
=
self
.
_new_curation_request
(
self
.
objects_to_delete
,
title
=
'test cr 1'
)
self
.
_get_curation_request_lines_and_schedule_deletion
(
curation_request
,
self
.
objects_to_delete
)
curation_request
.
submit
()
self
.
tic
()
decisions
=
self
.
_get_decisions_and_schedule_deletion
(
curation_request
,
self
.
objects_to_delete
)
self
.
assertEqual
(
len
(
decisions
),
1
)
def
_create_curation_request_awaiting_validation
(
self
):
self
.
login
()
curation_request
=
self
.
_new_curation_request
(
self
.
objects_to_delete
,
title
=
'test cr 1'
)
lines
=
self
.
_get_curation_request_lines_and_schedule_deletion
(
curation_request
,
self
.
objects_to_delete
)
self
.
assertEqual
(
len
(
lines
),
1
)
curated
=
lines
[
0
].
getAggregateValue
()
curation_request
.
submit
()
self
.
tic
()
self
.
_get_decisions_and_schedule_deletion
(
curation_request
,
self
.
objects_to_delete
)
return
(
curation_request
,
curated
)
def
test_03_curation_request_lvalidation_publishes_curated_objects
(
self
):
curation_request
,
curated
=
self
.
_create_curation_request_awaiting_validation
()
curation_request
.
validate
()
self
.
assertEqual
(
curation_request
.
getSimulationState
(),
'validated'
)
self
.
assertEqual
(
curated
.
getValidationState
(),
'published'
)
def
test_04_curation_request_invalidation_cancels_curated_objects
(
self
):
curation_request
,
curated
=
self
.
_create_curation_request_awaiting_validation
()
curation_request
.
reject
()
self
.
assertEqual
(
curation_request
.
getSimulationState
(),
'rejected'
)
self
.
assertEqual
(
curated
.
getValidationState
(),
'cancelled'
)
def
_create_curation_request_awaiting_decision
(
self
):
self
.
login
()
curation_request
=
self
.
_new_curation_request
(
self
.
objects_to_delete
,
title
=
'test cr 1'
)
self
.
_get_curation_request_lines_and_schedule_deletion
(
curation_request
,
self
.
objects_to_delete
)
curation_request
.
submit
()
self
.
tic
()
decisions
=
self
.
_get_decisions_and_schedule_deletion
(
curation_request
,
self
.
objects_to_delete
)
self
.
assertEqual
(
len
(
decisions
),
1
)
decision
=
decisions
[
0
]
return
(
curation_request
,
decision
)
def
test_05_decision_approval_validates_curation_request
(
self
):
curation_request
,
decision
=
self
.
_create_curation_request_awaiting_decision
()
self
.
portal
.
portal_workflow
.
doActionFor
(
decision
,
'approve_action'
)
self
.
tic
()
self
.
assertEqual
(
curation_request
.
getSimulationState
(),
'validated'
)
def
test_06_decision_refusal_invalidates_curation_request
(
self
):
curation_request
,
decision
=
self
.
_create_curation_request_awaiting_decision
()
self
.
portal
.
portal_workflow
.
doActionFor
(
decision
,
'refuse_action'
)
self
.
tic
()
self
.
assertEqual
(
curation_request
.
getSimulationState
(),
'rejected'
)
bt5/erp5_curation_request/TestTemplateItem/portal_components/test.erp5.testCurationRequest.xml
deleted
100644 → 0
View file @
7d1e22e8
<?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>
testCurationRequest
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testCurationRequest
</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.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<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>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_curation_request/bt/template_test_id_list
deleted
100644 → 0
View file @
7d1e22e8
test.erp5.testCurationRequest
\ 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