[Erp5-report] r45295 luke - /erp5/trunk/products/ERP5/tests/testBusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Apr 11 17:16:55 CEST 2011


Author: luke
Date: Mon Apr 11 17:16:55 2011
New Revision: 45295

URL: http://svn.erp5.org?rev=45295&view=rev
Log:
 - implement tests for all filesystem based documents by using mixins
 - fix test_BusinessTemplateWithDocumentTestRemoved after convertion to mixin

Modified:
    erp5/trunk/products/ERP5/tests/testBusinessTemplate.py

Modified: erp5/trunk/products/ERP5/tests/testBusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testBusinessTemplate.py?rev=45295&r1=45294&r2=45295&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testBusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testBusinessTemplate.py [utf8] Mon Apr 11 17:16:55 2011
@@ -7247,17 +7247,45 @@ class TestDocumentTemplateItem(BusinessT
     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 \



More information about the Erp5-report mailing list