Exemplo n.º 1
0
    def test_next_events_url(self):
        # if there is an 'events' object in the portal root, we expect
        # the events portlet to link to it
        if "events" in self.portal:
            self.portal._delObject("events")
        lb = ICalendarLinkbase(self.portal)
        self.failUnless("@@search?advanced_search=True&start.query" in lb.next_events_url())

        self.portal.invokeFactory("Folder", "events")
        self.failUnless(lb.next_events_url().endswith("/events"))
Exemplo n.º 2
0
    def test_next_events_url_and_navigation_root(self):
        # ensure support of INavigationRoot features dosen't break #9246 #9668
        self.portal.invokeFactory("Folder", "mynewsite")
        directlyProvides(self.portal.mynewsite, INavigationRoot)
        self.failUnless(INavigationRoot.providedBy(self.portal.mynewsite))

        lb = ICalendarLinkbase(self.portal.mynewsite)
        self.failUnless("mynewsite/@@search?advanced_search=True&start.query" in lb.next_events_url())

        self.portal.mynewsite.invokeFactory("Folder", "events")
        self.failUnless(lb.next_events_url().endswith("/mynewsite/events"))
    def test_events_url_with_navigation_root(self):
        # ensure support of INavigationRoot features dosen't break #9246 #9668
        self.portal.invokeFactory('Folder', 'mynewsite')
        directlyProvides(self.portal.mynewsite, INavigationRoot)
        self.failUnless(INavigationRoot.providedBy(self.portal.mynewsite))
        lb = ICalendarLinkbase(self.portal.mynewsite)

        url = 'http://nohost/plone/mynewsite/@@event_listing?mode=day&date=2012-12-07'
        self.failUnless(lb.date_events_url('2012-12-07') == url)

        url = 'http://nohost/plone/mynewsite/@@event_listing?mode=all'
        self.failUnless(lb.all_events_url() == url)

        url = 'http://nohost/plone/mynewsite/@@event_listing?mode=future'
        self.failUnless(lb.next_events_url() == url)

        url = 'http://nohost/plone/mynewsite/@@event_listing?mode=past'
        self.failUnless(lb.past_events_url() == url)
 def test_next_events_url(self):
     lb = ICalendarLinkbase(self.portal)
     url = 'http://nohost/plone/@@event_listing?mode=future'
     self.failUnless(lb.next_events_url() == url)