Example #1
0
def createDatabase(s):
    ls = LoginSystem(store=s)
    ls.installOn(s)
    acc = ls.addAccount('test', 'example.com', 'asdf')
    ss = acc.avatars.open()
    gph = GarbageProtocolHandler(store=ss, garbage=7)
    gph.installOn(ss)
def createDatabase(s):
    ls = LoginSystem(store=s)
    ls.installOn(s)
    acc = ls.addAccount(*CREDENTIALS)
    ss = acc.avatars.open()
    gph = GarbageProtocolHandler(store=ss, garbage=GARBAGE_LEVEL)
    gph.installOn(ss)
Example #3
0
def createDatabase(s):
    ls = LoginSystem(store=s)
    ls.installOn(s)
    acc = ls.addAccount(*CREDENTIALS)
    ss = acc.avatars.open()
    gph = GarbageProtocolHandler(store=ss, garbage=GARBAGE_LEVEL)
    gph.installOn(ss)
Example #4
0
    def setUp(self):
        """
        Make a store, an account/substore, an indexer, and call startService()
        on the superstore's IService so the batch process interactions that
        happen in fulltext.py work
        """
        self.dbdir = self.mktemp()
        self.path = u'index'

        superstore = store.Store(self.dbdir)

        loginSystem = LoginSystem(store=superstore)
        installOn(loginSystem, superstore)

        account = loginSystem.addAccount(u'testuser', u'example.com', None)
        substore = account.avatars.open()

        self.store = substore
        self.indexer = self.createIndexer()

        self.svc = IService(superstore)
        self.svc.startService()

        # Make sure the indexer is actually available
        writer = self.openWriteIndex()
        writer.close()
Example #5
0
    def doRendering(self, fragmentClass):
        """
        Verify that the given fragment class will render without raising an
        exception.
        """
        siteStore = Store()

        loginSystem = LoginSystem(store=siteStore)
        installOn(loginSystem, siteStore)
        p = Product(
            store=siteStore, types=["xmantissa.webadmin.LocalUserBrowser", "xmantissa.signup.SignupConfiguration"]
        )
        account = loginSystem.addAccount(u"testuser", u"localhost", None)
        p.installProductOn(account.avatars.open())
        f = fragmentClass(None, u"testuser", account)

        p = LivePage(docFactory=stan(html[head(render=directive("liveglue")), body(render=lambda ctx, data: f)]))
        f.setFragmentParent(p)

        ctx = WovenContext()
        req = FakeRequest()
        ctx.remember(req, IRequest)

        d = p.renderHTTP(ctx)

        def rendered(ign):
            p.action_close(None)

        d.addCallback(rendered)
        return d
Example #6
0
    def doRendering(self, fragmentClass):
        """
        Verify that the given fragment class will render without raising an
        exception.
        """
        siteStore = Store()

        loginSystem = LoginSystem(store=siteStore)
        installOn(loginSystem, siteStore)
        p = Product(store=siteStore, types=["xmantissa.webadmin.LocalUserBrowser",
                                            "xmantissa.signup.SignupConfiguration"])
        account = loginSystem.addAccount(u'testuser', u'localhost', None)
        p.installProductOn(account.avatars.open())
        f = fragmentClass(None, u'testuser', account)

        p = LivePage(
            docFactory=stan(
                html[
                    head(render=directive('liveglue')),
                    body(render=lambda ctx, data: f)]))
        f.setFragmentParent(p)

        ctx = WovenContext()
        req = FakeRequest()
        ctx.remember(req, IRequest)

        d = p.renderHTTP(ctx)
        def rendered(ign):
            p.action_close(None)
        d.addCallback(rendered)
        return d
Example #7
0
    def setUp(self):
        """
        Make a store, an account/substore, an indexer, and call startService()
        on the superstore's IService so the batch process interactions that
        happen in fulltext.py work
        """
        self.dbdir = self.mktemp()
        self.path = u'index'

        superstore = store.Store(self.dbdir)

        loginSystem = LoginSystem(store=superstore)
        installOn(loginSystem, superstore)

        account = loginSystem.addAccount(u'testuser', u'example.com', None)
        substore = account.avatars.open()

        self.store = substore
        self.indexer = self.createIndexer()

        self.svc = IService(superstore)
        self.svc.startService()

        # Make sure the indexer is actually available
        writer = self.openWriteIndex()
        writer.close()
Example #8
0
def createDatabase(s):
    ls = LoginSystem(store=s)
    ls.installOn(s)
    acc = ls.addAccount(u"test", u"example.com", "asdf")
    ss = acc.avatars.open()
    gph = GarbageProtocolHandler(store=ss, garbage=7)
    gph.installOn(ss)
def createDatabase(s):
    loginSystem = LoginSystem(store=s)
    loginSystem.installOn(s)
    sip = SIPServer(store=s)
    sip.startService()
    account = loginSystem.addAccount(u'testuser', u'localhost', None)
    subStore = account.avatars.open()
    VoicemailDispatcher(store=subStore,
                        localHost='localhost').installOn(subStore)
    sip.stopService()
Example #10
0
def createDatabase(s):
    """
    Create an account in the given store and install a MailTransferAgent on
    both the given store and the substore for that account.
    """
    loginSystem = LoginSystem(store=s)
    loginSystem.installOn(s)

    mta = MailTransferAgent(store=s)
    mta.installOn(s)
def createDatabase(store):
    """
    Instantiate a L{PrivateApplication} in C{store} and install it.
    """
    loginSystem = LoginSystem(store=store)
    installOn(loginSystem, store)
    account = loginSystem.addAccount(USERNAME, DOMAIN, None)
    subStore = account.avatars.open()

    app = PrivateApplication(store=subStore, preferredTheme=PREFERRED_THEME, privateKey=PRIVATE_KEY)
    installOn(app, subStore)
Example #12
0
    def setUp(self):
        """
        Create a site store and a user store with a L{LocalUserBrowser}
        installed on it.
        """
        self.siteStore = Store()
        self.loginSystem = LoginSystem(store=self.siteStore)
        installOn(self.loginSystem, self.siteStore)

        self.userStore = Store()
        self.userStore.parent = self.siteStore
        self.browser = LocalUserBrowser(store=self.userStore)
Example #13
0
 def setUp(self):
     """
     Set up some state.
     """
     self.s = Store()
     self.ls = LoginSystem(store=self.s)
     installOn(self.ls, self.s)
     acct = self.ls.addAccount(u'right',
                               u'host',
                               u'',
                               verified=True,
                               internal=True)
     acct.addLoginMethod(u'wrong', u'host', internal=False, verified=False)
     self.share = sharing.shareItem(self.ls, shareID=u'loginsystem')
Example #14
0
def createDatabase(store):
    """
    Instantiate a L{PrivateApplication} in C{store} and install it.
    """
    loginSystem = LoginSystem(store=store)
    installOn(loginSystem, store)
    account = loginSystem.addAccount(USERNAME, DOMAIN, None)
    subStore = account.avatars.open()

    app = PrivateApplication(
        store=subStore,
        preferredTheme=PREFERRED_THEME,
        privateKey=PRIVATE_KEY)
    installOn(app, subStore)
Example #15
0
def createDatabase(s):
    """
    Create an account in the given store and install a MailTransferAgent on
    both the given store and the substore for that account.
    """
    Scheduler(store=s).installOn(s)

    loginSystem = LoginSystem(store=s)
    loginSystem.installOn(s)

    mta = MailTransferAgent(store=s)
    mta.installOn(s)

    account = loginSystem.addAccount(u'testuser', u'localhost', None)
    subStore = account.avatars.open()
    SubScheduler(store=subStore).installOn(subStore)
    mda = MailTransferAgent(store=subStore)
    mda.installOn(subStore)
def createDatabase(s):
    """
    Create an account in the given store and install a MailTransferAgent on
    both the given store and the substore for that account.
    """
    Scheduler(store=s).installOn(s)

    loginSystem = LoginSystem(store=s)
    loginSystem.installOn(s)

    mta = MailTransferAgent(store=s)
    mta.installOn(s)

    account = loginSystem.addAccount(u'testuser', u'localhost', None)
    subStore = account.avatars.open()
    SubScheduler(store=subStore).installOn(subStore)
    mda = MailTransferAgent(store=subStore)
    mda.installOn(subStore)
 def setUp(self):
     """
     Create a store with a LoginSystem and a portal wrapped around it.
     """
     store = Store()
     installOn(LoginSystem(store=store), store)
     realm = IRealm(store)
     checker = ICredentialsChecker(store)
     self.portal = Portal(realm, [checker])
Example #18
0
 def setUp(self):
     """
     Set up some state.
     """
     self.s = Store()
     self.ls = LoginSystem(store=self.s)
     installOn(self.ls, self.s)
     acct = self.ls.addAccount(
         u'right', u'host', u'', verified=True, internal=True)
     acct.addLoginMethod(
         u'wrong', u'host', internal=False, verified=False)
     self.share = sharing.shareItem(self.ls, shareID=u'loginsystem')
Example #19
0
    def setUp(self):
        """
        Create a site store and a user store with a L{LocalUserBrowser}
        installed on it.
        """
        self.siteStore = Store()
        self.loginSystem = LoginSystem(store=self.siteStore)
        installOn(self.loginSystem, self.siteStore)

        self.userStore = Store()
        self.userStore.parent = self.siteStore
        self.browser = LocalUserBrowser(store=self.userStore)
Example #20
0
class UserInteractionFragmentTestCase(TestCase):
    def setUp(self):
        """
        Create a site store and a user store with a L{LocalUserBrowser}
        installed on it.
        """
        self.siteStore = Store()
        self.loginSystem = LoginSystem(store=self.siteStore)
        installOn(self.loginSystem, self.siteStore)

        self.userStore = Store()
        self.userStore.parent = self.siteStore
        self.browser = LocalUserBrowser(store=self.userStore)


    def test_createUser(self):
        """
        Test that L{webadmin.UserInteractionFragment.createUser} method
        actually creates a user.
        """
        userInteractionFragment = UserInteractionFragment(self.browser)
        userInteractionFragment.createUser(
            u'testuser', u'localhost', u'password')

        account = self.loginSystem.accountByAddress(u'testuser', u'localhost')
        self.assertEquals(account.password, u'password')


    def test_rendering(self):
        """
        Test that L{webadmin.UserInteractionFragment} renders without raising
        any exceptions.
        """
        f = UserInteractionFragment(self.browser)

        p = LivePage(
            docFactory=stan(
                html[
                    head(render=directive('liveglue')),
                    body(render=lambda ctx, data: f)]))
        f.setFragmentParent(p)

        ctx = WovenContext()
        req = FakeRequest()
        ctx.remember(req, IRequest)

        d = p.renderHTTP(ctx)
        def rendered(ign):
            p.action_close(None)
        d.addCallback(rendered)
        return d
Example #21
0
class UserInteractionFragmentTestCase(TestCase):
    def setUp(self):
        """
        Create a site store and a user store with a L{LocalUserBrowser}
        installed on it.
        """
        self.siteStore = Store()
        self.loginSystem = LoginSystem(store=self.siteStore)
        installOn(self.loginSystem, self.siteStore)

        self.userStore = Store()
        self.userStore.parent = self.siteStore
        self.browser = LocalUserBrowser(store=self.userStore)

    def test_createUser(self):
        """
        Test that L{webadmin.UserInteractionFragment.createUser} method
        actually creates a user.
        """
        userInteractionFragment = UserInteractionFragment(self.browser)
        userInteractionFragment.createUser(u"testuser", u"localhost", u"password")

        account = self.loginSystem.accountByAddress(u"testuser", u"localhost")
        self.assertEquals(account.password, u"password")

    def test_rendering(self):
        """
        Test that L{webadmin.UserInteractionFragment} renders without raising
        any exceptions.
        """
        f = UserInteractionFragment(self.browser)

        p = LivePage(docFactory=stan(html[head(render=directive("liveglue")), body(render=lambda ctx, data: f)]))
        f.setFragmentParent(p)

        ctx = WovenContext()
        req = FakeRequest()
        ctx.remember(req, IRequest)

        d = p.renderHTTP(ctx)

        def rendered(ign):
            p.action_close(None)

        d.addCallback(rendered)
        return d
def createStore(testCase):
    location = testCase.mktemp()
    s = Store(location)
    da = DeliveryAgent(store=s)
    installOn(da, s)
    makeSomeMessages(testCase, da, location)
    installOn(POP3Up(store=s), s)
    ls = LoginSystem(store=s)
    installOn(ls, s)

    # Engage in some trickery to allow this to be used as its own user.
    la = LoginAccount(store=s, password=u'asdfjkl;', avatars=s, disabled=False)
    LoginMethod(store=s,
                account=la,
                localpart=u'user',
                domain=u'example.com',
                protocol=u'email',
                internal=True,
                verified=True)
    return s
Example #23
0
class WebSharingTestCase(TestCase):
    """
    Tests for L{xmantissa.websharing.linkTo}
    """
    def setUp(self):
        """
        Set up some state.
        """
        self.s = Store()
        self.ls = LoginSystem(store=self.s)
        installOn(self.ls, self.s)
        acct = self.ls.addAccount(u'right',
                                  u'host',
                                  u'',
                                  verified=True,
                                  internal=True)
        acct.addLoginMethod(u'wrong', u'host', internal=False, verified=False)
        self.share = sharing.shareItem(self.ls, shareID=u'loginsystem')

    def test_noLoginMethods(self):
        """
        L{websharing.linkTo} raises a L{RuntimeError} when the shared item is
        in a store with no internal L{LoginMethod}s.
        """
        for lm in self.s.query(LoginMethod):
            lm.internal = False
        self.assertRaises(RuntimeError, websharing.linkTo, self.share)

    def test_linkToShare(self):
        """
        Test that L{xmantissa.websharing.linkTo} generates a URL using the
        localpart of the account's internal L{axiom.userbase.LoginMethod}
        """
        self._verifyPath(websharing.linkTo(self.share))

    def _verifyPath(self, linkURL):
        """
        Verify that the given url matches the test's expectations.
        """
        self.failUnless(
            isinstance(linkURL, url.URL),
            "linkTo should return a nevow.url.URL, not %r" % (type(linkURL)))
        self.assertEquals(str(linkURL), '/users/right/loginsystem')

    def test_linkToProxy(self):
        """
        Test that L{xmantissa.websharing.linkTo} generates a URL that I can
        link to.
        """
        self._verifyPath(
            websharing.linkTo(
                sharing.getShare(self.s, sharing.getEveryoneRole(self.s),
                                 u'loginsystem')))

    def test_shareURLInjectsShareID(self):
        """
        Test that L{xmantissa.websharing._ShareURL} injects the share ID the
        constructor is passed when C{child} is called.
        """
        for (shareID, urlID) in [(u'a', 'a'), (u'\xe9', '%C3%A9')]:
            shareURL = websharing._ShareURL(shareID, netloc='', scheme='')
            self.assertEqual(str(shareURL.child('c')), '/%s/c' % urlID)
            # make sure subsequent child calls on the original have the same
            # behaviour
            self.assertEqual(str(shareURL.child('d')), '/%s/d' % urlID)
            # and that child calls on the returned urls don't (i.e. not
            # '/a/c/a/d'
            self.assertEqual(str(shareURL.child('c').child('d')),
                             '/%s/c/d' % urlID)

    def test_shareURLNoStoreID(self):
        """
        Test that L{xmantissa.websharing._ShareURL} behaves like a regular
        L{nevow.url.URL} when no store ID is passed.
        """
        shareURL = websharing._ShareURL(None, netloc='', scheme='')
        self.assertEqual(str(shareURL.child('a')), '/a')
        self.assertEqual(str(shareURL.child('a').child('b')), '/a/b')

    def test_shareURLNoClassmethodConstructors(self):
        """
        Verify that the C{fromRequest}, C{fromContext} and C{fromString}
        constructors on L{xmantissa.websharing._ShareURL} throw
        L{NotImplementedError}.
        """
        for meth in (websharing._ShareURL.fromRequest,
                     websharing._ShareURL.fromString,
                     websharing._ShareURL.fromContext):
            self.assertRaises(NotImplementedError, lambda: meth(None))

    def test_shareURLCloneMaintainsShareID(self):
        """
        Test that L{xmantissa.websharing._ShareURL} can be cloned, and that
        clones will remember the share ID.
        """
        shareURL = websharing._ShareURL(u'a', netloc='', scheme='')
        shareURL = shareURL.cloneURL('', '', None, None, '')
        self.assertEqual(shareURL._shareID, u'a')

    def test_defaultShareIDInteractionMatching(self):
        """
        Verify that L{websharing.linkTo} does not explicitly include a share
        ID in the URL if the ID of the share it is passed matches the default.
        """
        websharing.addDefaultShareID(self.s, u'share-id', 0)
        sharing.shareItem(Shareable(store=self.s), shareID=u'share-id')
        share = sharing.getShare(self.s, sharing.getEveryoneRole(self.s),
                                 u'share-id')
        url = websharing.linkTo(share)
        self.assertEqual(str(url), '/users/right/')
        # and if we call child()
        self.assertEqual(str(url.child('child')),
                         '/users/right/share-id/child')

    def test_defaultShareIDInteractionNoMatch(self):
        """
        Verify that L{websharing.linkTo} explicitly includes a share ID in the
        URL if the ID of the share it is passed doesn't match the default.
        """
        websharing.addDefaultShareID(self.s, u'share-id', 0)
        shareable = Shareable(store=self.s)
        sharing.shareItem(Shareable(store=self.s), shareID=u'not-the-share-id')
        share = sharing.getShare(self.s, sharing.getEveryoneRole(self.s),
                                 u'not-the-share-id')
        url = websharing.linkTo(share)
        self.assertEqual(str(url), '/users/right/not-the-share-id')

    def test_appStoreLinkTo(self):
        """
        When L{websharing.linkTo} is called on a shared item in an app store,
        it returns an URL with a single path segment consisting of the app's
        name.
        """
        s = Store(dbdir=self.mktemp())
        Mantissa().installSite(s, u"localhost", u"", False)
        Mantissa().installAdmin(s, u'admin', u'localhost', u'asdf')
        off = offering.Offering(
            name=u'test_offering',
            description=u'Offering for creating a sample app store',
            siteRequirements=[],
            appPowerups=[TestAppPowerup],
            installablePowerups=[],
            loginInterfaces=[],
            themes=[],
        )
        userbase = s.findUnique(LoginSystem)
        adminAccount = userbase.accountByAddress(u'admin', u'localhost')
        conf = adminAccount.avatars.open().findUnique(
            offering.OfferingConfiguration)
        conf.installOffering(off, None)
        ss = userbase.accountByAddress(off.name, None).avatars.open()
        sharedItem = sharing.getEveryoneRole(ss).getShare(
            websharing.getDefaultShareID(ss))
        linkURL = websharing.linkTo(sharedItem)
        self.failUnless(
            isinstance(linkURL, url.URL),
            "linkTo should return a nevow.url.URL, not %r" % (type(linkURL)))
        self.assertEquals(str(linkURL), '/test_offering/')
Example #24
0
def createDatabase(s):
    LoginSystem(store=s).installOn(s)
    POP3Listener(store=s).installOn(s)
Example #25
0
class WebSharingTestCase(TestCase):
    """
    Tests for L{xmantissa.websharing.linkTo}
    """
    def setUp(self):
        """
        Set up some state.
        """
        self.s = Store()
        self.ls = LoginSystem(store=self.s)
        installOn(self.ls, self.s)
        acct = self.ls.addAccount(
            u'right', u'host', u'', verified=True, internal=True)
        acct.addLoginMethod(
            u'wrong', u'host', internal=False, verified=False)
        self.share = sharing.shareItem(self.ls, shareID=u'loginsystem')


    def test_noLoginMethods(self):
        """
        L{websharing.linkTo} raises a L{RuntimeError} when the shared item is
        in a store with no internal L{LoginMethod}s.
        """
        for lm in self.s.query(LoginMethod):
            lm.internal = False
        self.assertRaises(RuntimeError, websharing.linkTo, self.share)


    def test_linkToShare(self):
        """
        Test that L{xmantissa.websharing.linkTo} generates a URL using the
        localpart of the account's internal L{axiom.userbase.LoginMethod}
        """
        self._verifyPath(websharing.linkTo(self.share))


    def _verifyPath(self, linkURL):
        """
        Verify that the given url matches the test's expectations.
        """
        self.failUnless(isinstance(linkURL, url.URL),
                        "linkTo should return a nevow.url.URL, not %r" %
                        (type(linkURL)))
        self.assertEquals(str(linkURL), '/users/right/loginsystem')


    def test_linkToProxy(self):
        """
        Test that L{xmantissa.websharing.linkTo} generates a URL that I can
        link to.
        """
        self._verifyPath(
            websharing.linkTo(sharing.getShare(self.s, sharing.getEveryoneRole(
                        self.s), u'loginsystem')))


    def test_shareURLInjectsShareID(self):
        """
        Test that L{xmantissa.websharing._ShareURL} injects the share ID the
        constructor is passed when C{child} is called.
        """
        for (shareID, urlID) in [(u'a', 'a'), (u'\xe9', '%C3%A9')]:
            shareURL = websharing._ShareURL(shareID, netloc='', scheme='')
            self.assertEqual(str(shareURL.child('c')), '/%s/c' % urlID)
            # make sure subsequent child calls on the original have the same
            # behaviour
            self.assertEqual(str(shareURL.child('d')), '/%s/d' % urlID)
            # and that child calls on the returned urls don't (i.e. not
            # '/a/c/a/d'
            self.assertEqual(str(shareURL.child('c').child('d')),
                             '/%s/c/d' % urlID)


    def test_shareURLNoStoreID(self):
        """
        Test that L{xmantissa.websharing._ShareURL} behaves like a regular
        L{nevow.url.URL} when no store ID is passed.
        """
        shareURL = websharing._ShareURL(None, netloc='', scheme='')
        self.assertEqual(str(shareURL.child('a')), '/a')
        self.assertEqual(str(shareURL.child('a').child('b')), '/a/b')


    def test_shareURLNoClassmethodConstructors(self):
        """
        Verify that the C{fromRequest}, C{fromContext} and C{fromString}
        constructors on L{xmantissa.websharing._ShareURL} throw
        L{NotImplementedError}.
        """
        for meth in (websharing._ShareURL.fromRequest,
                     websharing._ShareURL.fromString,
                     websharing._ShareURL.fromContext):
            self.assertRaises(
                NotImplementedError,
                lambda: meth(None))


    def test_shareURLCloneMaintainsShareID(self):
        """
        Test that L{xmantissa.websharing._ShareURL} can be cloned, and that
        clones will remember the share ID.
        """
        shareURL = websharing._ShareURL(u'a', netloc='', scheme='')
        shareURL = shareURL.cloneURL('', '', None, None, '')
        self.assertEqual(shareURL._shareID, u'a')


    def test_defaultShareIDInteractionMatching(self):
        """
        Verify that L{websharing.linkTo} does not explicitly include a share
        ID in the URL if the ID of the share it is passed matches the default.
        """
        websharing.addDefaultShareID(self.s, u'share-id', 0)
        sharing.shareItem(Shareable(store=self.s), shareID=u'share-id')
        share = sharing.getShare(
            self.s, sharing.getEveryoneRole(self.s), u'share-id')
        url = websharing.linkTo(share)
        self.assertEqual(str(url), '/users/right/')
        # and if we call child()
        self.assertEqual(str(url.child('child')), '/users/right/share-id/child')


    def test_defaultShareIDInteractionNoMatch(self):
        """
        Verify that L{websharing.linkTo} explicitly includes a share ID in the
        URL if the ID of the share it is passed doesn't match the default.
        """
        websharing.addDefaultShareID(self.s, u'share-id', 0)
        shareable = Shareable(store=self.s)
        sharing.shareItem(Shareable(store=self.s), shareID=u'not-the-share-id')
        share = sharing.getShare(
            self.s, sharing.getEveryoneRole(self.s), u'not-the-share-id')
        url = websharing.linkTo(share)
        self.assertEqual(str(url), '/users/right/not-the-share-id')


    def test_appStoreLinkTo(self):
        """
        When L{websharing.linkTo} is called on a shared item in an app store,
        it returns an URL with a single path segment consisting of the app's
        name.
        """
        s = Store(dbdir=self.mktemp())
        Mantissa().installSite(s, u"localhost", u"", False)
        Mantissa().installAdmin(s, u'admin', u'localhost', u'asdf')
        off = offering.Offering(
            name=u'test_offering',
            description=u'Offering for creating a sample app store',
            siteRequirements=[],
            appPowerups=[TestAppPowerup],
            installablePowerups=[],
            loginInterfaces=[],
            themes=[],
            )
        userbase = s.findUnique(LoginSystem)
        adminAccount = userbase.accountByAddress(u'admin', u'localhost')
        conf = adminAccount.avatars.open().findUnique(
            offering.OfferingConfiguration)
        conf.installOffering(off, None)
        ss = userbase.accountByAddress(off.name, None).avatars.open()
        sharedItem = sharing.getEveryoneRole(ss).getShare(
            websharing.getDefaultShareID(ss))
        linkURL = websharing.linkTo(sharedItem)
        self.failUnless(isinstance(linkURL, url.URL),
                        "linkTo should return a nevow.url.URL, not %r" %
                        (type(linkURL)))
        self.assertEquals(str(linkURL), '/test_offering/')
Example #26
0
 def setUp(self):
     self.siteStore = Store(self.mktemp())
     installOn(LoginSystem(store=self.siteStore), self.siteStore)
     offering = entropyoff.plugin
     IOfferingTechnician(self.siteStore).installOffering(offering)