コード例 #1
0
    def test_remove_multible_addressblocks(self):
        addressblock = self.contentpage.get(
            self.contentpage.invokeFactory('AddressBlock', 'addressblock'))
        addressblock.processForm()
        addressblock2 = self.contentpage.get(
            self.contentpage.invokeFactory('AddressBlock', 'addressblock2'))
        addressblock2.processForm()

        # Remove first addressblock
        self.contentpage.manage_delObjects([addressblock.getId()])
        self.assertTrue(IOrgUnitMarker.providedBy(self.contentpage))

        # Remove second addressblock
        self.contentpage.manage_delObjects([addressblock2.getId()])
        self.assertFalse(IOrgUnitMarker.providedBy(self.contentpage))
コード例 #2
0
 def test_add_addressblock(self):
     addressblock = self.contentpage.get(
         self.contentpage.invokeFactory('AddressBlock', 'addressblock'))
     addressblock.processForm()
     self.assertTrue(IOrgUnitMarker.providedBy(self.contentpage))
     self.assertTrue(self.catalog(
         {'object_procvides': IOrgUnitMarker.__identifier__}))
コード例 #3
0
    def test_copy_addressblock(self):
        addressblock = self.contentpage.get(
            self.contentpage.invokeFactory('AddressBlock', 'addressblock'))
        addressblock.processForm()
        transaction.savepoint(optimistic=True)
        # Copy and paste
        cutted = self.contentpage.manage_copyObjects([addressblock.getId()])
        transaction.commit()
        self.contentpage2.manage_pasteObjects(cutted)
        transaction.commit()

        self.assertIn('addressblock', self.contentpage.objectIds())
        self.assertTrue(IOrgUnitMarker.providedBy(self.contentpage))

        self.assertIn('addressblock', self.contentpage2.objectIds())
        self.assertTrue(IOrgUnitMarker.providedBy(self.contentpage2))
コード例 #4
0
 def test_add_multible_addressblocks(self):
     addressblock = self.contentpage.get(
         self.contentpage.invokeFactory('AddressBlock', 'addressblock'))
     addressblock.processForm()
     addressblock2 = self.contentpage.get(
         self.contentpage.invokeFactory('AddressBlock', 'addressblock2'))
     addressblock2.processForm()
     self.assertTrue(IOrgUnitMarker.providedBy(self.contentpage))
コード例 #5
0
    def test_add_addressblock_createobject(self):
        # CreateObject triggers diffrent events than invokefactory
        self._auth()
        self.browser.open("%s/createObject?type_name=AddressBlock" %
            self.contentpage.absolute_url())
        self.browser.getControl('Save').click()

        self.assertTrue(IOrgUnitMarker.providedBy(self.contentpage))
        self.assertTrue(self.catalog(
            {'object_procvides': IOrgUnitMarker.__identifier__}))
コード例 #6
0
    def test_remove_addressblock(self):
        addressblock = self.contentpage.get(
            self.contentpage.invokeFactory('AddressBlock', 'addressblock'))
        addressblock.processForm()

        self.contentpage.manage_delObjects([addressblock.getId()])
        transaction.savepoint(optimistic=True)
        # self._auth()
        # self.browser.open(
        #     addressblock.absolute_url() + '/delete_confirmation')
        # self.browser.getControl("Delete").click()

        self.assertFalse(IOrgUnitMarker.providedBy(self.contentpage))
コード例 #7
0
 def mark(self):
     if not IOrgUnitMarker.providedBy(self.parent):
         alsoProvides(self.parent, IOrgUnitMarker)
         self.parent.reindexObject(idxs=['object_provides'])