Commit 4bacaa20 authored by Jérome Perrin's avatar Jérome Perrin

Merge !534 Do not suggest bad practices in new test component template

Numbering tests can be used to control test execution order, but developers should write independent tests that should not rely on test execution order.

`getTitle` is useless. Test runner will print the class name.

/reviewed-on !534
parents 01166a1d d67a0763
...@@ -210,9 +210,6 @@ class Test(ERP5TypeTestCase): ...@@ -210,9 +210,6 @@ class Test(ERP5TypeTestCase):
A Sample Test Class A Sample Test Class
""" """
def getTitle(self):
return "SampleTest"
def getBusinessTemplateList(self): def getBusinessTemplateList(self):
""" """
Tuple of Business Templates we need to install Tuple of Business Templates we need to install
...@@ -226,16 +223,15 @@ class Test(ERP5TypeTestCase): ...@@ -226,16 +223,15 @@ class Test(ERP5TypeTestCase):
# here, you can create the categories and objects your test will depend on # here, you can create the categories and objects your test will depend on
pass pass
def test_01_sampleTest(self): def test_sampleTest(self):
""" """
A Sample Test A Sample Test
For the method to be called during the test, For the method to be called during the test,
its name must start with '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. See https://docs.python.org/2/library/unittest.html for help with available
Tests methods (self.assert... and self.failIf...) assertion methods.
are defined in /usr/lib/python/unittest.py.
""" """
self.assertEqual(0, 1) self.assertEqual(0, 1)
''' % DEFAULT_TEST_TEMPLATE_COPYRIGHT ''' % DEFAULT_TEST_TEMPLATE_COPYRIGHT
......
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