Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(7)  |  Derive(0)  |  Import(2)

src/g/o/gocept.linkchecker-3.0a9/src/gocept/linkchecker/tests/test_linkchecker.py   gocept.linkchecker(Download)
import Acquisition
from Products.CMFCore.utils import getToolByName
from Products.Archetypes.tests.test_sitepolicy import makeContent
from gocept.linkchecker.tests.base import LinkCheckerTestCase
from gocept.linkchecker.interfaces import ILink
    def test_link_registration(self):
        self.loginAsPortalOwner()
        doc = makeContent(self.portal, portal_type="Document", id="asdf")
 
        lc = getToolByName(self.portal, 'portal_linkchecker')
        for x in links:
            id = self.portal.generateUniqueId()
            doc = makeContent(self.portal, portal_type="Document", id=id)
            doc.edit('html', '<a href="%s">asdf</a>' % x)
            docs.append(doc)
    def test_byobject(self):
        self.loginAsPortalOwner()
        lc = getToolByName(self.portal, 'portal_linkchecker')
        db = lc.database
        doc = makeContent(self.portal, portal_type="Document", id="asdf")

src/g/o/gocept.linkchecker-3.0a9/src/gocept/linkchecker/tests/test_retrievers.py   gocept.linkchecker(Download)
from Products.Archetypes.tests.utils import *
 
from Products.Archetypes.tests.test_sitepolicy import makeContent
from Products.CMFCore.utils import getToolByName
 
 
        url = "http://asdf.org"
        event = makeContent(self.portal, portal_type="Event", id="asdf")
        event.edit(event_url=url)
        event.setText(text)
 
        url = "http://www.asdf.org/asdf?asdf"
        ob = makeContent(self.portal, portal_type="Link", id="asdf")
        ob.edit(url)
 
 
        url = "http://www.asdf.org/asdf?asdf"
        ob = makeContent(self.portal, portal_type="Document", id="asdf")
        ob.setText(text)
 
 
        url = "http://www.asdf.org/asdf?asdf"
        ob = makeContent(self.portal, portal_type="Document", id="asdf")
        ob.setText(text, mimetype='text/structured')