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
Yoji Takeuchi
erp5
Commits
8d306ef7
Commit
8d306ef7
authored
Apr 01, 2015
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Type: remove any changes made in the context of erp5 workflows
parent
6179de0f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
27 deletions
+13
-27
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+1
-3
product/ERP5Type/tests/testERP5Type.py
product/ERP5Type/tests/testERP5Type.py
+12
-24
No files found.
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
8d306ef7
...
@@ -794,9 +794,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
...
@@ -794,9 +794,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
light_install
=
self
.
enableLightInstall
()
light_install
=
self
.
enableLightInstall
()
create_activities
=
self
.
enableActivityTool
()
create_activities
=
self
.
enableActivityTool
()
hot_reindexing
=
self
.
enableHotReindexing
()
hot_reindexing
=
self
.
enableHotReindexing
()
# install business template and its dependencies
for
x
,
y
in
((
"erp5_core_proxy_field_legacy"
,
"erp5_base"
),
for
x
,
y
in
((
"erp5_workflow"
,
"erp5_base"
),
(
"erp5_core_proxy_field_legacy"
,
"erp5_base"
),
(
"erp5_stock_cache"
,
"erp5_pdm"
)):
(
"erp5_stock_cache"
,
"erp5_pdm"
)):
if
x
not
in
template_list
:
if
x
not
in
template_list
:
try
:
try
:
...
...
product/ERP5Type/tests/testERP5Type.py
View file @
8d306ef7
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
import
cPickle
import
cPickle
import
unittest
import
unittest
import
sys
import
sys
import
pdb
import
transaction
import
transaction
from
random
import
randint
from
random
import
randint
from
Acquisition
import
aq_base
from
Acquisition
import
aq_base
...
@@ -975,24 +975,17 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
...
@@ -975,24 +975,17 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
"""Tests for workflow state. assumes that validation state is chained to
"""Tests for workflow state. assumes that validation state is chained to
the Person portal type and that this workflow has 'validation_state' as
the Person portal type and that this workflow has 'validation_state' as
state_variable.
state_variable.
zwj: 28-1-2015 add ERP5Workflow compability.
"""
"""
self
.
portal
.
Localizer
=
DummyLocalizer
()
self
.
portal
.
Localizer
=
DummyLocalizer
()
message_catalog
=
self
.
portal
.
Localizer
.
erp5_ui
message_catalog
=
self
.
portal
.
Localizer
.
erp5_ui
person
=
self
.
getPersonModule
().
newContent
(
id
=
'1'
,
portal_type
=
'Person'
)
person
=
self
.
getPersonModule
().
newContent
(
id
=
'1'
,
portal_type
=
'Person'
)
# those are assumptions for this test.
if
not
person
.
getTypeInfo
().
getTypeERP5WorkflowList
():
wf
=
self
.
getWorkflowTool
().
validation_workflow
wf
=
self
.
getWorkflowTool
().
validation_workflow
# those are assumptions for this test.
self
.
assertTrue
(
wf
.
getId
()
in
self
.
assertTrue
(
wf
.
getId
()
in
self
.
getWorkflowTool
().
getChainFor
(
'Person'
))
self
.
getWorkflowTool
().
getChainFor
(
'Person'
))
self
.
assertEqual
(
'validation_state'
,
wf
.
variables
.
getStateVar
())
self
.
assertEqual
(
'validation_state'
,
wf
.
variables
.
getStateVar
())
initial_state
=
wf
.
states
[
wf
.
initial_state
]
initial_state
=
wf
.
states
[
wf
.
initial_state
]
other_state
=
wf
.
states
[
'validated'
]
other_state
=
wf
.
states
[
'validated'
]
else
:
wf
=
self
.
getPortalObject
().
getDefaultModule
(
'Workflow'
).
_getOb
(
'erp5_validation_workflow'
)
initial_state
=
wf
.
getSourceValue
()
other_state
=
wf
.
_getOb
(
'validated'
)
self
.
assertTrue
(
hasattr
(
person
,
'getValidationState'
))
self
.
assertTrue
(
hasattr
(
person
,
'getValidationState'
))
self
.
assertTrue
(
hasattr
(
person
,
'getValidationStateTitle'
))
self
.
assertTrue
(
hasattr
(
person
,
'getValidationStateTitle'
))
...
@@ -1836,13 +1829,10 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
...
@@ -1836,13 +1829,10 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
# Create a new temporary person object.
# Create a new temporary person object.
from
Products.ERP5Type.Document
import
newTempPerson
from
Products.ERP5Type.Document
import
newTempPerson
o
=
newTempPerson
(
portal
,
'temp_person_1'
)
o
=
newTempPerson
(
portal
,
'temp_person_1'
)
#pdb.set_trace()
self
.
assertTrue
(
o
.
isTempObject
())
self
.
assertTrue
(
o
.
isTempObject
())
self
.
assertEqual
(
o
.
getOriginalDocument
(),
None
)
self
.
assertEqual
(
o
.
getOriginalDocument
(),
None
)
# This should generate a workflow method.
# This should generate a workflow method.
# ERP5 workflow doesn't support this step, pass,
if
not
o
.
getTypeInfo
().
getTypeERP5WorkflowList
():
self
.
assertEqual
(
o
.
getValidationState
(),
'draft'
)
self
.
assertEqual
(
o
.
getValidationState
(),
'draft'
)
o
.
validate
()
o
.
validate
()
self
.
assertEqual
(
o
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
o
.
getValidationState
(),
'validated'
)
...
@@ -1883,8 +1873,6 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
...
@@ -1883,8 +1873,6 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self
.
assertTrue
(
o
.
isTempObject
())
self
.
assertTrue
(
o
.
isTempObject
())
# This should call methods generated for the persistent object.
# This should call methods generated for the persistent object.
### zwj: ERP5Workflow doesn't support, pass
if
not
o
.
getTypeInfo
().
getTypeERP5WorkflowList
():
self
.
assertEqual
(
o
.
getValidationState
(),
'draft'
)
self
.
assertEqual
(
o
.
getValidationState
(),
'draft'
)
o
.
validate
()
o
.
validate
()
self
.
assertEqual
(
o
.
getValidationState
(),
'validated'
)
self
.
assertEqual
(
o
.
getValidationState
(),
'validated'
)
...
...
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