Commit 76972a37 authored by Łukasz Nowak's avatar Łukasz Nowak

- check that task reference is set upon creation and coping


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25919 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 912e639b
...@@ -637,6 +637,29 @@ class TestTask(TestTaskMixin, ERP5TypeTestCase): ...@@ -637,6 +637,29 @@ class TestTask(TestTaskMixin, ERP5TypeTestCase):
simulation_tool.manage_permission(permission, roles=(), acquire=1) simulation_tool.manage_permission(permission, roles=(), acquire=1)
self.logout() self.logout()
def test_06_testTaskTitleAndReference(self, quiet=0, run=run_all_test):
"""Tests that task reference is set upon creation and coping"""
if not run: return
self.stepLogin()
portal = self.getPortal()
task_module = portal.getDefaultModule(portal_type=self.task_portal_type)
task = task_module.newContent(portal_type=self.task_portal_type)
self.assertEqual(
task.getReference(),
'T %s'%(task.getId(),)
)
cb_data = task_module.manage_copyObjects(ids=[task.getId()])
p_data = task_module.manage_pasteObjects(cb_data)
new_task = task_module._getOb(p_data[0]['new_id'])
self.assertEqual(
new_task.getReference(),
'T %s'%(new_task.getId(),)
)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestTask)) suite.addTest(unittest.makeSuite(TestTask))
......
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