Commit 6fa04ed1 authored by Nicolas Delaby's avatar Nicolas Delaby

It is obsolete to consider that DMS will be in inconsistent state

If 2 documents exists with same reference, version, language but different
portal_types as long as only one is published in same time.

The user has to take a decision regarding which document to display.
Thats's why the test check that document stays in 'draft' state.
Otherwise side effects might happens on published document like
a Web Page is replaced by File (which display nothing) automatically.




git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41751 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ccc09207
......@@ -2131,16 +2131,19 @@ return 1
portal = self.portal
# contribute a document, then make it not editable and check we can not contribute to it
upload_file = makeFileUpload('TEST-en-002.doc')
kw = dict(file=upload_file, \
synchronous_metadata_discovery=True)
kw = dict(file=upload_file, synchronous_metadata_discovery=True)
document = self.portal.Base_contribute(**kw)
self.stepTic()
# passing another portal type should raise an exception
self.stepTic()
# passing another portal type allows to create a
# new document, but in draft state.
# Then User takes a decision to choose which document to publish
kw['portal_type'] = "Spreadsheet"
self.assertRaises(ValueError, self.portal.Base_contribute, **kw)
new_document = self.portal.Base_contribute(**kw)
self.assertEquals(new_document.getValidationState(), 'draft')
# make it read only
document.manage_permission(Permissions.ModifyPortalContent, [])
new_document.manage_permission(Permissions.ModifyPortalContent, [])
self.stepTic()
kw.pop('portal_type')
self.assertRaises(Unauthorized, self.portal.Base_contribute, **kw)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment