Beispiel #1
0
    def test_oguid_by_path_returns_none_for_invalid_path(self):
        task = create(Builder('task'))

        controller = ISuccessorTaskController(task)
        self.assertEquals(
            None,
            controller.get_oguid_by_path('/plone/not-existing/', 'client1'))
    def test_oguid_by_path_returns_none_for_invalid_path(self):
        task = create(Builder('task'))

        controller = ISuccessorTaskController(task)
        self.assertEquals(
            None,
            controller.get_oguid_by_path('/plone/not-existing/', 'client1'))
    def test_oguid_by_path_returns_none_for_invalid_admin_unit_id(self):
        task = create(Builder('task'))

        controller = ISuccessorTaskController(task)
        self.assertEquals(
            None,
            controller.get_oguid_by_path('/'.join(task.getPhysicalPath()), 'client2'))
Beispiel #4
0
    def test_oguid_by_path_returns_none_for_invalid_admin_unit_id(self):
        task = create(Builder('task'))

        controller = ISuccessorTaskController(task)
        self.assertEquals(
            None,
            controller.get_oguid_by_path('/'.join(task.getPhysicalPath()),
                                         'client2'))
Beispiel #5
0
    def test_oguid_by_path_returns_the_oguid_of_the_accordant_task(self):
        intids = getUtility(IIntIds)
        url_tool = getToolByName(self.portal, 'portal_url')

        task = create(Builder('task'))

        controller = ISuccessorTaskController(task)
        self.assertEquals(
            u'client1:%s' % (intids.getId(task)),
            controller.get_oguid_by_path(
                '/'.join(url_tool.getRelativeContentPath(task)), 'client1'))
    def test_oguid_by_path_returns_the_oguid_of_the_accordant_task(self):
        intids = getUtility(IIntIds)
        url_tool = getToolByName(self.portal, 'portal_url')

        task = create(Builder('task'))

        controller = ISuccessorTaskController(task)
        self.assertEquals(
            u'client1:%s' % (intids.getId(task)),
            controller.get_oguid_by_path(
                '/'.join(url_tool.getRelativeContentPath(task)),
                'client1'))