Commit 42cd2e22 authored by Jérome Perrin's avatar Jérome Perrin

add tests for 'hasData' method on document and temp documents


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16360 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4977c15c
......@@ -439,6 +439,20 @@ class TestDocument(ERP5TypeTestCase):
doc.edit(base_data='OOo')
self.assertEquals(len('OOo'), doc.get_size())
def testOOoDocument_hasData(self):
# test hasData on OOoDocument
doc = self.portal.document_module.newContent(portal_type='Spreadsheet')
self.failIf(doc.hasData())
doc.edit(file=makeFileUpload('import_data_list.ods'))
self.failUnless(doc.hasData())
def testTempOOoDocument_hasData(self):
# test hasData on TempOOoDocument
from Products.ERP5Type.Document import newTempOOoDocument
doc = newTempOOoDocument(self.portal, 'tmp')
self.failIf(doc.hasData())
doc.edit(file=makeFileUpload('import_data_list.ods'))
self.failUnless(doc.hasData())
if __name__ == '__main__':
framework()
......
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