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
Labels
Merge Requests
140
Merge Requests
140
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
4f0a8c34
Commit
4f0a8c34
authored
Jan 23, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add auto archive test (for document_publication_workflow).
parent
eb218b6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
product/ERP5OOo/tests/testDms.py
product/ERP5OOo/tests/testDms.py
+45
-0
No files found.
product/ERP5OOo/tests/testDms.py
View file @
4f0a8c34
...
...
@@ -2571,6 +2571,51 @@ return 1
self
.
_test_document_publication_workflow
(
'Text'
,
'share_alive_action'
)
def
test_document_publication_workflow_archiveVersion
(
self
):
""" Test old versions of a doc are auto archived. """
portal
=
self
.
portal
upload_file
=
makeFileUpload
(
'TEST-en-002.doc'
)
kw
=
dict
(
file
=
upload_file
,
synchronous_metadata_discovery
=
True
)
document_002
=
self
.
portal
.
Base_contribute
(
**
kw
)
document_002
.
publish
()
self
.
stepTic
()
document_003
=
document_002
.
Base_createCloneDocument
(
batch_mode
=
1
)
document_003
.
setVersion
(
'003'
)
document_003
.
publish
()
self
.
stepTic
()
self
.
assertEqual
(
'published'
,
document_003
.
getValidationState
())
self
.
assertEqual
(
'archived'
,
document_002
.
getValidationState
())
# check if in any case document doesn't archive itself
# (i.e. shared_alive -> published or any other similar chain)
document_004
=
document_003
.
Base_createCloneDocument
(
batch_mode
=
1
)
document_004
.
setVersion
(
'004'
)
document_004
.
shareAlive
()
self
.
stepTic
()
document_004
.
publish
()
self
.
stepTic
()
self
.
assertEqual
(
'published'
,
document_004
.
getValidationState
())
# check case when no language is used
document_nolang_005
=
document_004
.
Base_createCloneDocument
(
batch_mode
=
1
)
document_nolang_005
.
setVersion
(
'TEST-no-lang'
)
document_nolang_005
.
setVersion
(
'005'
)
document_nolang_005
.
setLanguage
(
None
)
document_nolang_005
.
publish
()
self
.
stepTic
()
self
.
assertEqual
(
'published'
,
document_nolang_005
.
getValidationState
())
document_nolang_006
=
document_nolang_005
.
Base_createCloneDocument
(
batch_mode
=
1
)
document_nolang_006
.
setVersion
(
'006'
)
document_nolang_006
.
shareAlive
()
self
.
stepTic
()
self
.
assertEqual
(
'archived'
,
document_nolang_005
.
getValidationState
())
self
.
assertEqual
(
'shared_alive'
,
document_nolang_006
.
getValidationState
())
class
TestDocumentWithSecurity
(
TestDocumentMixin
):
username
=
'yusei'
...
...
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