Пример #1
0
    def test_month_year_filter_on_eventlisting(self):
        event = create(Builder('event page').within(self.folder).having(
            startDate=DateTime('2014/02/02'),
            endDate=DateTime('2014/02/06'))
        )
        view = EventListing(self.folder, self.request)

        self.assertEquals(0, len(view.get_items()))
        self.request.set('archive', '2014/02/01')

        self.assertEquals(1, len(view.get_items()))
Пример #2
0
    def test_pending_events_are_still_visible(self):
        event = create(Builder('event page').within(self.folder).having(
            startDate=DateTime()-1,
            endDate=DateTime()+1)
        )

        view = EventListing(self.folder, self.request)

        self.assertEqual(
            [event],
            [brain.getObject() for brain in view.get_items()])