From 38aab762d9158a3309f2545b39ccd4ca17fdcf51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com> Date: Mon, 11 Apr 2011 15:16:55 +0000 Subject: [PATCH] - implement tests for all filesystem based documents by using mixins - fix test_BusinessTemplateWithDocumentTestRemoved after convertion to mixin git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45295 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/tests/testBusinessTemplate.py | 36 +++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/product/ERP5/tests/testBusinessTemplate.py b/product/ERP5/tests/testBusinessTemplate.py index da5a9f59e4..5ef9c736fa 100644 --- a/product/ERP5/tests/testBusinessTemplate.py +++ b/product/ERP5/tests/testBusinessTemplate.py @@ -7247,17 +7247,45 @@ class TestDocumentTemplateItem(BusinessTemplateMixin): sequence_list.play(self) class TestConstraintTemplateItem(TestDocumentTemplateItem): - def test(self): - raise NotImplemenetedError + document_title = 'UnitTest' + document_data = ' \nclass UnitTest: \n """ \n Fake constraint for unit test \n \ + """ \n _properties = ( \n ) \n _categories = ( \n ) \n\n' + document_data_updated = ' \nclass UnitTest2: \n """ \n Second Fake constraint for unit test \n \ + """ \n _properties = ( \n ) \n _categories = ( \n ) \n\n' + document_base_path = os.path.join(getConfiguration().instancehome, 'Constraint') + template_property = 'template_constraint_id_list' class TestExtensionTemplateItem(TestDocumentTemplateItem): - def test(self): - raise NotImplemenetedError + document_title = 'UnitTest' + document_data = """class UnitTest: + meta_type = 'ERP5 Unit Test' + portal_type = 'Unit Test'""" + document_data_updated = """class UnitTest: + meta_type = 'ERP5 Unit Test' + portal_type = 'Unit Test' + def updated(self): + pass""" + document_base_path = os.path.join(getConfiguration().instancehome, 'Extensions') + template_property = 'template_extension_id_list' class TestTestTemplateItem(TestDocumentTemplateItem): + document_title = 'UnitTest' + document_data = """class UnitTest: + meta_type = 'ERP5 Unit Test' + portal_type = 'Unit Test'""" + document_data_updated = """class UnitTest: + meta_type = 'ERP5 Unit Test' + portal_type = 'Unit Test' + def updated(self): + pass""" + document_base_path = os.path.join(getConfiguration().instancehome, 'tests') + template_property = 'template_test_id_list' + def test_BusinessTemplateWithDocumentTestRemoved(self): """Checks that if Business Template defines Document and Test Document is not removed""" + self.document_base_path = os.path.join(getConfiguration().instancehome, 'Document') + self.template_property = 'template_document_id_list' sequence_list = SequenceList() sequence_string = '\ CreateDocument \ -- 2.30.9