[Erp5-report] r41751 nicolas - /erp5/trunk/products/ERP5OOo/tests/testDms.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Dec 24 13:57:32 CET 2010
Author: nicolas
Date: Fri Dec 24 13:57:32 2010
New Revision: 41751
URL: http://svn.erp5.org?rev=41751&view=rev
Log:
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.
Modified:
erp5/trunk/products/ERP5OOo/tests/testDms.py
Modified: erp5/trunk/products/ERP5OOo/tests/testDms.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testDms.py?rev=41751&r1=41750&r2=41751&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] Fri Dec 24 13:57:32 2010
@@ -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)
More information about the Erp5-report
mailing list