Commit ccccd460 authored by Sebastien Robin's avatar Sebastien Robin Committed by Xiaowu Zhang

simulation: use portal type instances in tests instead of just classes

This allows code of movement group to still works when they use
setter/getters defined by property sheets
parent ec87d8a7
......@@ -442,12 +442,11 @@ class TestMovementGroupCommonAPI(MovementGroupTestCase):
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([]), [])
for portal_type in self.portal.portal_types.objectValues():
portal_type_id = portal_type.getId()
if portal_type_id.endswith("Movement Group"):
movement_group = self.builder.newContent(portal_type=portal_type_id)
self.assertEqual(movement_group._separate([]), [])
class TestPropertyGroupingMovementGroup(MovementGroupTestCase):
......
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