From 42cd2e22a242aaaacc073e7dde459ba6c7d2364e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Fri, 14 Sep 2007 11:16:06 +0000 Subject: [PATCH] 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 --- product/ERP5OOo/tests/testDms.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/product/ERP5OOo/tests/testDms.py b/product/ERP5OOo/tests/testDms.py index 681f3291c1..8cbea7f369 100644 --- a/product/ERP5OOo/tests/testDms.py +++ b/product/ERP5OOo/tests/testDms.py @@ -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() -- 2.30.9