Commit 61a6d987 authored by Lucas Carvalho's avatar Lucas Carvalho

We must be able to upload the same file over and over again.

parent 5d6cbf59
...@@ -116,3 +116,22 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase): ...@@ -116,3 +116,22 @@ class TestShaCache(ShaCacheMixin, ERP5TypeTestCase):
self.assertNotEquals(None, document) self.assertNotEquals(None, document)
self.assertEquals(self.data, document.getData()) self.assertEquals(self.data, document.getData())
def test_put_file_twice(self):
"""
Check if is allowed to put the same file twice.
"""
self.putFile()
self.assertEquals(1, len(self.portal.document_module))
document = self.portal.document_module.contentValues()[0]
self.assertEquals('Published', document.getValidationStateTitle())
self.putFile()
self.assertEquals(2, len(self.portal.document_module))
document2 = self.portal.document_module.contentValues()[1]
self.assertEquals('Published', document2.getValidationStateTitle())
self.assertEquals('Archived', document.getValidationStateTitle())
44 45
\ No newline at end of file \ No newline at end of file
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