Commit 08edcd2c authored by Vincent Pelletier's avatar Vincent Pelletier

Add a test for serialization_tag SQL wildcard support.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19440 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f873072b
...@@ -2776,6 +2776,26 @@ class TestCMFActivity(ERP5TypeTestCase): ...@@ -2776,6 +2776,26 @@ class TestCMFActivity(ERP5TypeTestCase):
self.tic() self.tic()
result = activity_tool.getMessageList() result = activity_tool.getMessageList()
self.assertEqual(len(result), 0) self.assertEqual(len(result), 0)
# Third scenario with SQL wildcards: activate, distribute, activate, distribute
# Create first activity and distribute: it must be distributed
organisation.activate(activity=activity, serialization_tag='foo/bar/%').getTitle()
get_transaction().commit()
result = activity_tool.getMessageList()
self.assertEqual(len(result), 1)
activity_tool.distribute()
result = activity_tool.getMessageList()
self.assertEqual(len([x for x in result if x.processing_node == 0]), 1)
# Create second activity and distribute: it must *NOT* be distributed
organisation.activate(activity=activity, serialization_tag='foo/%').getTitle()
get_transaction().commit()
result = activity_tool.getMessageList()
self.assertEqual(len(result), 2)
activity_tool.distribute()
result = activity_tool.getMessageList()
self.assertEqual(len([x for x in result if x.processing_node == 0]), 1)
self.tic()
result = activity_tool.getMessageList()
self.assertEqual(len(result), 0)
def test_106_checkSerializationTagSQLDict(self, quiet=0, run=run_all_test): def test_106_checkSerializationTagSQLDict(self, quiet=0, run=run_all_test):
if not run: return if not run: return
......
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