Commit f12c3a54 authored by Yusei Tahara's avatar Yusei Tahara

Add a test case and make sure that MovementGroup._separate method works with...

Add a test case and make sure that MovementGroup._separate method works with an empty list argument.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26508 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 44f6a7b9
......@@ -432,6 +432,20 @@ class TestCategoryMovementGroup(MovementGroupTestCase):
group.getGroupEditDict() == dict(destination_list=['A'],
source_list=['2'])]))
class TestMovementGroupCommonAPI(unittest.TestCase):
def test_separateMethod(self):
"""Make sure that _separate method works if argument is an empty list."""
import Products.ERP5Type.Document
for name in Products.ERP5Type.Document.__dict__:
if name[0].isupper() and name.endswith('MovementGroup'):
module = getattr(Products.ERP5Type.Document, name)
class_ = getattr(module, name)
instance = class_('dummy')
self.assertEqual(instance._separate([]), [])
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestPropertyMovementGroup))
......@@ -441,5 +455,6 @@ def test_suite():
suite.addTest(unittest.makeSuite(TestDeliveryCausalityAssignmentMovementGroup))
suite.addTest(unittest.makeSuite(TestDuplicatedKeyRaiseException))
suite.addTest(unittest.makeSuite(TestCategoryMovementGroup))
suite.addTest(unittest.makeSuite(TestMovementGroupCommonAPI))
return suite
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