diff --git a/bt5/erp5_post_test/TestTemplateItem/portal_components/test.erp5.testFunctionalPostModuleNoSelenium.py b/bt5/erp5_post_test/TestTemplateItem/portal_components/test.erp5.testFunctionalPostModuleNoSelenium.py new file mode 100644 index 0000000000000000000000000000000000000000..c19d102be61b6d3b30eb745e253b28ca61691188 --- /dev/null +++ b/bt5/erp5_post_test/TestTemplateItem/portal_components/test.erp5.testFunctionalPostModuleNoSelenium.py @@ -0,0 +1,83 @@ +############################################################################## +# +# Copyright (c) 2002-2017 Nexedi SA and Contributors. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsibility of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# guarantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################## +import unittest +from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase + +class TestHTMLPostLogic(ERP5TypeTestCase): + """ + A Sample Test Class + """ + + def getTitle(self): + return "SampleTest" + + def getBusinessTemplateList(self): + """ + Tuple of Business Templates we need to install + """ + return ('erp5_base',) + + def afterSetUp(self): + """ + This is ran before anything, used to set the environment + + # here, you can create the categories and objects your test will depend on + """ + pass + + + def test_01_sampleTest(self): + """ + A Sample Test + + For the method to be called during the test, + its name must start with 'test'. + The '_01_' part of the name is not mandatory, + it just allows you to define in which order the tests are to be launched. + Tests methods (self.assert... and self.failIf...) + are defined in /usr/lib/python/unittest.py. + """ + portal = self.getPortal() + post_module = portal.post_module + + post_1 = post_module.newContent(portal_type='HTML Post', id="post_1") + post_2 = post_module.newContent(portal_type='HTML Post', id="post_2") + post_3 = post_module.newContent(portal_type='HTML Post', id="post_3") + + post_1.setFollowUpValue(post_3) + post_2.setFollowUpValue(post_3) + post_2.setPredecessorValue(post_1) + + post_2_predecessor = post_2.getPredecessorValueList()[0] + post_2_follow_up = post_2.getFollowUpValueList()[0] + self.assertEqual(post_2_predecessor.getTitle(), post_1.getTitle()) + self.assertEqual(post_2_follow_up.getTitle(), post_3.getTitle()) + +def test_suite(): + suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite(TestHTMLPostLogic)) + return suite \ No newline at end of file diff --git a/bt5/erp5_post_test/TestTemplateItem/portal_components/test.erp5.testFunctionalPostModuleNoSelenium.xml b/bt5/erp5_post_test/TestTemplateItem/portal_components/test.erp5.testFunctionalPostModuleNoSelenium.xml new file mode 100644 index 0000000000000000000000000000000000000000..9dcc385d5021a1ee0ac18e50cb0a10e7443f8538 --- /dev/null +++ b/bt5/erp5_post_test/TestTemplateItem/portal_components/test.erp5.testFunctionalPostModuleNoSelenium.xml @@ -0,0 +1,123 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Test Component" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_recorded_property_dict</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>default_reference</string> </key> + <value> <string>testFunctionalPostModuleNoSelenium</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>test.erp5.testFunctionalPostModuleNoSelenium</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Test Component</string> </value> + </item> + <item> + <key> <string>sid</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>text_content_error_message</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>text_content_warning_message</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>version</string> </key> + <value> <string>erp5</string> </value> + </item> + <item> + <key> <string>workflow_history</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary/> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="PersistentMapping" module="Persistence.mapping"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>data</string> </key> + <value> + <dictionary> + <item> + <key> <string>component_validation_workflow</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> + <pickle> + <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> + </pickle> + <pickle> + <tuple> + <none/> + <list> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> <string>validate</string> </value> + </item> + <item> + <key> <string>validation_state</string> </key> + <value> <string>validated</string> </value> + </item> + </dictionary> + </list> + </tuple> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_post_test/bt/dependency_list b/bt5/erp5_post_test/bt/dependency_list new file mode 100644 index 0000000000000000000000000000000000000000..fb27283bbd17cb65110feb2cd124f975239c259f --- /dev/null +++ b/bt5/erp5_post_test/bt/dependency_list @@ -0,0 +1 @@ +erp5_post \ No newline at end of file diff --git a/bt5/erp5_post_test/bt/description b/bt5/erp5_post_test/bt/description new file mode 100644 index 0000000000000000000000000000000000000000..9139feac183a35b68e3badcedcca97138e38987a --- /dev/null +++ b/bt5/erp5_post_test/bt/description @@ -0,0 +1 @@ +The test file of erp5_post. \ No newline at end of file diff --git a/bt5/erp5_post_test/bt/license b/bt5/erp5_post_test/bt/license new file mode 100644 index 0000000000000000000000000000000000000000..3a3e12bcad97e4b3bdd6a8bb499fd23a4bcb0819 --- /dev/null +++ b/bt5/erp5_post_test/bt/license @@ -0,0 +1 @@ +GPL \ No newline at end of file diff --git a/bt5/erp5_post_test/bt/maintainer_list b/bt5/erp5_post_test/bt/maintainer_list new file mode 100644 index 0000000000000000000000000000000000000000..d589f042e666402f8c4d51fddea83285c1960519 --- /dev/null +++ b/bt5/erp5_post_test/bt/maintainer_list @@ -0,0 +1 @@ +Boxiang Sun \ No newline at end of file diff --git a/bt5/erp5_post_test/bt/template_format_version b/bt5/erp5_post_test/bt/template_format_version new file mode 100644 index 0000000000000000000000000000000000000000..56a6051ca2b02b04ef92d5150c9ef600403cb1de --- /dev/null +++ b/bt5/erp5_post_test/bt/template_format_version @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/bt5/erp5_post_test/bt/template_test_id_list b/bt5/erp5_post_test/bt/template_test_id_list new file mode 100644 index 0000000000000000000000000000000000000000..6f55e129d12f11163ba98358653f33aaaa630bce --- /dev/null +++ b/bt5/erp5_post_test/bt/template_test_id_list @@ -0,0 +1 @@ +test.erp5.testFunctionalPostModuleNoSelenium \ No newline at end of file diff --git a/bt5/erp5_post_test/bt/test_dependency_list b/bt5/erp5_post_test/bt/test_dependency_list new file mode 100644 index 0000000000000000000000000000000000000000..bff77e32d84989312efdf3b2caed2e39f9a513ed --- /dev/null +++ b/bt5/erp5_post_test/bt/test_dependency_list @@ -0,0 +1 @@ +erp5_full_text_mroonga_catalog \ No newline at end of file diff --git a/bt5/erp5_post_test/bt/title b/bt5/erp5_post_test/bt/title new file mode 100644 index 0000000000000000000000000000000000000000..9cb1637d2341bb22171f71e731cd7df05ac57578 --- /dev/null +++ b/bt5/erp5_post_test/bt/title @@ -0,0 +1 @@ +erp5_post_test \ No newline at end of file