Example #1
0
 def testExdate(self):
     page = RecurringEventPage(owner=self.user,
                               slug="sleep",
                               title="Sleep In",
                               repeat=Recurrence(dtstart=dt.date(
                                   2018, 5, 1),
                                                 freq=MONTHLY,
                                                 byweekday=[SA(+2)]),
                               time_from=dt.time(7),
                               time_to=dt.time(10, 30),
                               tz=pytz.timezone("Pacific/Auckland"),
                               details="<p>zzzZZZZZZZZZ</p>",
                               location="Bed")
     self.calendar.add_child(instance=page)
     page.save_revision().publish()
     except1 = CancellationPage(
         owner=self.user,
         slug="2018-06-09-cancellation",
         title="Cancellation for Saturday 9th of June",
         overrides=page,
         except_date=dt.date(2018, 6, 9))
     page.add_child(instance=except1)
     except1.save_revision().publish()
     except2 = CancellationPage(
         owner=self.user,
         slug="2018-07-14-cancellation",
         title="Cancellation for Saturday 14th of July",
         overrides=page,
         except_date=dt.date(2018, 7, 14))
     page.add_child(instance=except2)
     except2.save_revision().publish()
     vev = VEventFactory().makeFromPage(except1)
     self.assertIs(type(vev), RecurringVEvent)
     vev.set('UID', "this-is-not-a-unique-identifier")
     tz = pytz.timezone("Pacific/Auckland")
     exDates = [exDate.dt for exDate in vev['EXDATE'].dts]
     self.assertEqual(exDates, [
         tz.localize(dt.datetime(2018, 6, 9, 7)),
         tz.localize(dt.datetime(2018, 7, 14, 7))
     ])
     sleepIn = b"\r\n".join([
         b"BEGIN:VEVENT", b"SUMMARY:Sleep In",
         b"DTSTART;TZID=Pacific/Auckland:20180512T070000",
         b"DTEND;TZID=Pacific/Auckland:20180512T103000",
         b"DTSTAMP:20180510T000000Z",
         b"UID:this-is-not-a-unique-identifier", b"SEQUENCE:1",
         b"RRULE:FREQ=MONTHLY;BYDAY=+2SA;WKST=SU",
         b"EXDATE;TZID=Pacific/Auckland:20180609T070000,20180714T070000",
         b"CREATED:20180510T000000Z", b"DESCRIPTION:zzzZZZZZZZZZ",
         b"LAST-MODIFIED:20180510T000000Z", b"LOCATION:Bed",
         b"URL:http://joy.test/events/sleep/",
         b"X-ALT-DESC;FMTTYPE=text/html:<p>zzzZZZZZZZZZ</p>", b"END:VEVENT",
         b""
     ])
     self.assertEqual(vev.to_ical(), sleepIn)
Example #2
0
 def testCancellation(self):
     # NOTE:
     # Cancellations are represented by EXDATE in VEVENT not as their own
     # VEVENT instance.  Yes, this means the cancellation_title and
     # cancellation_details are lost.
     page = RecurringEventPage(owner=self.user,
                               slug="sleep",
                               title="Sleep In",
                               repeat=Recurrence(dtstart=dt.date(
                                   2018, 5, 1),
                                                 freq=MONTHLY,
                                                 byweekday=[SA(+2)]),
                               time_from=dt.time(7),
                               time_to=dt.time(10, 30),
                               tz=pytz.timezone("Pacific/Auckland"),
                               details="<p>zzzZZZZZZZZZ</p>",
                               location="Bed")
     self.calendar.add_child(instance=page)
     page.save_revision().publish()
     except1 = CancellationPage(
         owner=self.user,
         slug="2018-06-09-cancellation",
         title="Cancellation for Saturday 9th of June",
         cancellation_title="Get up early",
         overrides=page,
         except_date=dt.date(2018, 6, 9))
     page.add_child(instance=except1)
     except1.save_revision().publish()
     vexcept = CancellationVEvent.fromPage(except1)
     self.assertEqual(vexcept['SUMMARY'], "Get up early")
     self.assertEqual(vexcept['DESCRIPTION'], "")
     self.assertEqual(vexcept.to_ical(), b"\r\n")
Example #3
0
    def testServeCancellation(self):
        cancellation = CancellationPage(owner = self.user,
                                        overrides = self.event,
                                        except_date = dt.date(2017,5,2),
                                        cancellation_title   = "Workshop Cancelled",
                                        cancellation_details = "No workshop this month")
        self.event.add_child(instance=cancellation)
        cancellation.save_revision().publish()
        response = self.handler.serve(self.calendar,
                                      self._getRequest("/events/"))
        self.assertEqual(response.status_code, 200)
        soup = BeautifulSoup(response.content, "xml")
        channel = soup.channel
        self.assertEqual(channel.title.string, "Events")
        self.assertEqual(len(channel("item")), 2)
        item = channel("item")[1]
        self.assertEqual(item.title.string, "Workshop Cancelled")
        self.assertEqual(item.link.string, "http://joy.test/events/workshop/2017-05-02-cancellation/")
        self.assertEqual(item.enclosure.decode(),
                         '<enclosure length="773" type="image/png" '
                         'url="http://joy.test/media/images/{}"/>'.format(self.rendName))
        self.assertEqual(item.description.decode(), """<description>\n\n\n
  &lt;div class="joy-ev-when joy-field"&gt;
    Tuesday 2nd of May 2017
  &lt;/div&gt;\n\n\n\n
&lt;div class="rich-text"&gt;No workshop this month&lt;/div&gt;\n</description>""")
        self.assertEqual(item.guid.get("isPermaLink"), "true")
        self.assertEqual(item.guid.string, "http://joy.test/events/workshop/2017-05-02-cancellation/")
        self.assertEqual(item.pubDate.string, "Sun, 27 Mar 2016 00:00:00 +0000")
Example #4
0
 def setUp(self):
     self.home = Page.objects.get(slug='home')
     self.user = User.objects.create_user('i', '*****@*****.**', 's3(r3t')
     self.calendar = CalendarPage(owner=self.user,
                                  slug="events",
                                  title="Events")
     self.home.add_child(instance=self.calendar)
     self.calendar.save_revision().publish()
     self.event = RecurringEventPage(slug="test-meeting",
                                     title="Test Meeting",
                                     repeat=Recurrence(
                                         dtstart=dt.date(1989, 1, 1),
                                         freq=WEEKLY,
                                         byweekday=[MO, WE, FR]),
                                     time_from=dt.time(13),
                                     time_to=dt.time(15, 30))
     self.calendar.add_child(instance=self.event)
     self.cancellation = CancellationPage(
         owner=self.user,
         overrides=self.event,
         except_date=dt.date(1989, 2, 1),
         cancellation_title="Meeting Cancelled",
         cancellation_details="Cancelled due to lack of interest")
     self.event.add_child(instance=self.cancellation)
     self.cancellation.save_revision().publish()
 def testPastDtCancelled(self):
     # a cancellation page trumps the holiday
     cancellation = CancellationPage(owner=self.user,
                                     overrides=self.event,
                                     except_date=dt.date(1989, 2, 6))
     self.event.add_child(instance=cancellation)
     self.assertEqual(self.closedHols._past_datetime_from,
                      datetimetz(1989, 1, 30, 13, 0))
Example #6
0
 def testFromCalendarPage(self):
     page = RecurringEventPage(owner=self.user,
                               slug="chess",
                               title="Chess",
                               repeat=Recurrence(dtstart=dt.date(
                                   2000, 1, 1),
                                                 freq=WEEKLY,
                                                 byweekday=[MO, WE, FR]),
                               time_from=dt.time(12),
                               time_to=dt.time(13))
     self.calendar.add_child(instance=page)
     page.save_revision().publish()
     cancellation = CancellationPage(
         owner=self.user,
         slug="2019-02-04-cancellation",
         title="Cancellation for Monday 4th of February",
         overrides=page,
         except_date=dt.date(2019, 2, 4),
         cancellation_title="No Chess Club Today")
     page.add_child(instance=cancellation)
     cancellation.save_revision().publish()
     postponement = PostponementPage(
         owner=self.user,
         slug="2019-10-02-postponement",
         title="Postponement for Wednesday 2nd of October",
         overrides=page,
         except_date=dt.date(2019, 10, 2),
         cancellation_title="",
         postponement_title="Early Morning Matches",
         date=dt.date(2019, 10, 3),
         time_from=dt.time(7, 30),
         time_to=dt.time(8, 30))
     page.add_child(instance=postponement)
     postponement.save_revision().publish()
     vcal = VCalendar.fromPage(self.calendar, self._getRequest("/events/"))
     export = vcal.to_ical()
     props = [
         b"SUMMARY:Chess",
         b"DTSTART;TZID=Asia/Tokyo:20000103T120000",
         b"DTEND;TZID=Asia/Tokyo:20000103T130000",
         b"DTSTAMP:20190121T060000Z",
         b"UID:",
         b"SEQUENCE:1",
         b"RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR;WKST=SU",
         b"EXDATE;TZID=Asia/Tokyo:20190204T120000",
         b"CREATED:20190121T060000Z",
         b"DESCRIPTION:",
         b"LAST-MODIFIED:20190121T060000Z",
         b"LOCATION:",
         b"URL:http://joy.test/events/chess/",
         b"SUMMARY:Early Morning Matches",
         b"DTSTART;TZID=Asia/Tokyo:20191003T073000",
         b"DTEND;TZID=Asia/Tokyo:20191003T083000",
         b"RECURRENCE-ID;TZID=Asia/Tokyo:20191002T120000",
     ]
     for prop in props:
         with self.subTest(prop=prop):
             self.assertIn(prop, export)
Example #7
0
 def testNeverOccursOn(self):
     cancellation = CancellationPage(owner=self.user,
                                     overrides=self.event,
                                     except_date=dt.date(1989, 2, 7),
                                     cancellation_title="Tuesday",
                                     cancellation_details="Banner")
     self.event.add_child(instance=cancellation)
     self.assertIsNone(cancellation._current_datetime_from)
     self.assertIsNone(cancellation._future_datetime_from)
     self.assertIsNone(cancellation._past_datetime_from)
Example #8
0
 def testBindWithoutOverrides25(self):
     cancellation = CancellationPage(owner = self.user,
                                     except_date = dt.date(2019,1,21))
     Form = get_form_for_model(CancellationPage, form_class=CancellationPageForm)
     form = Form(instance=cancellation, parent_page=self.event)
     panel = ExceptionDatePanel('except_date', classname='full-width')
     panel = panel.bind_to(instance=cancellation)
     panel = panel.bind_to(request=self._getRequest())
     panel = panel.bind_to(form=form)
     self.assertIsNotNone(panel.form)
     self.assertIsNone(panel.instance.overrides)
Example #9
0
 def testBindExceptionTZ25(self):
     cancellation = CancellationPage(owner = self.user,
                                     overrides = self.event,
                                     except_date = dt.date(2019,1,21))
     Form = get_form_for_model(CancellationPage, form_class=CancellationPageForm)
     form = Form(instance=cancellation, parent_page=self.event)
     panel = ExceptionDatePanel('except_date', classname='full-width')
     panel = panel.bind_to(instance=cancellation)
     panel = panel.bind_to(request=self._getRequest())
     panel = panel.bind_to(form=form)
     self.assertEqual(panel.exceptionTZ, "Asia/Tokyo")
Example #10
0
 def testBindOverridesRepeat25(self):
     cancellation = CancellationPage(owner = self.user,
                                     overrides = self.event,
                                     except_date = dt.date(2019,1,21))
     Form = get_form_for_model(CancellationPage, form_class=CancellationPageForm)
     form = Form(instance=cancellation, parent_page=self.event)
     widget = form['except_date'].field.widget
     panel = ExceptionDatePanel('except_date', classname='full-width')
     panel = panel.bind_to(instance=cancellation)
     panel = panel.bind_to(request=self._getRequest())
     panel = panel.bind_to(form=form)
     self.assertIs(widget.overrides_repeat, self.event.repeat)
     self.assertIsNone(panel.exceptionTZ)
Example #11
0
 def _cancel_1999_02_08(self):
     cancellation = CancellationPage(
         owner=self.user,
         overrides=self.event,
         except_date=dt.date(1999, 2, 8),
         cancellation_title="Restructure Pending",
         cancellation_details="Keep it quiet")
     self.event.add_child(instance=cancellation)
     PASSWORD = PageViewRestriction.PASSWORD
     restriction = PageViewRestriction.objects.create(
         restriction_type=PASSWORD, password="******", page=cancellation)
     restriction.save()
     return restriction
Example #12
0
 def setUp(self):
     site = Site.objects.get(is_default_site=True)
     site.hostname = "joy.test"
     site.save()
     self.home = getPage("/home/")
     self.user = User.objects.create_user('i', '*****@*****.**', 's3cr3t')
     self.requestFactory = RequestFactory()
     self.calendar = CalendarPage(owner = self.user,
                                  slug  = "events",
                                  title = "Events")
     self.home.add_child(instance=self.calendar)
     self.calendar.save_revision().publish()
     event = SimpleEventPage(owner = self.user,
                             slug   = "mini-fair",
                             title  = "Mini-Fair",
                             date   = dt.date(2018,4,7),
                             uid = "*****@*****.**")
     self.calendar.add_child(instance=event)
     event.save_revision().publish()
     event = RecurringEventPage(owner = self.user,
                                slug  = "tango-thursdays",
                                title = "Tango Thursdays",
                                details = "Weekly tango lessons at the Dance Spot",
                                repeat  = Recurrence(dtstart=dt.date(2018,3,29),
                                                     freq=WEEKLY,
                                                     byweekday=[TH]),
                                time_from = dt.time(19,30),
                                time_to   = dt.time(22,0),
                                tz        = pytz.timezone("US/Eastern"),
                                website   = "http://torontodancespot.com/",
                                location  = "622 Bloor St. W., Toronto ON, M6G 1K7",
                                uid = "*****@*****.**")
     self.calendar.add_child(instance=event)
     event.save_revision().publish()
     cancellation = CancellationPage(owner = self.user,
                                     slug  = "2019-02-14-cancellation",
                                     title = "Cancellation for Thursday 14th of April",
                                     overrides = event,
                                     except_date = dt.date(2019, 2, 14))
     event.add_child(instance=cancellation)
     cancellation.save_revision().publish()
     info = ExtraInfoPage(owner = self.user,
                          slug  = "2018-04-05-extra-info",
                          title = "Extra-Info for Thursday 5th of April",
                          overrides = event,
                          except_date = dt.date(2018, 4, 5),
                          extra_title = "Performance",
                          extra_information = "Performance for the public")
     event.add_child(instance=info)
     info.save_revision().publish()
Example #13
0
 def testWhenEver(self):
     event = RecurringEventPage(slug="XYZ",
                                title="Xylophone yacht zombies",
                                repeat=Recurrence(dtstart=dt.date(
                                    1989, 1, 1),
                                                  freq=WEEKLY,
                                                  byweekday=[FR]),
                                time_from=dt.time(19))
     self.calendar.add_child(instance=event)
     cancellation = CancellationPage(owner=self.user,
                                     overrides=event,
                                     except_date=dt.date(1989, 3, 10),
                                     cancellation_title="Cancelled")
     event.add_child(instance=cancellation)
     cancellation.save_revision().publish()
     self.assertEqual(cancellation.when, "Friday 10th of March 1989 at 7pm")
Example #14
0
 def testStatus(self):
     self.assertEqual(self.cancellation.status, "cancelled")
     self.assertEqual(self.cancellation.status_text,
                      "This event has been cancelled.")
     now = dt.datetime.now()
     myday = now.date() + dt.timedelta(1)
     friday = myday + dt.timedelta(days=(4 - myday.weekday()) % 7)
     futureCan = CancellationPage(owner=self.user,
                                  overrides=self.event,
                                  except_date=friday,
                                  cancellation_title="",
                                  cancellation_details="")
     self.event.add_child(instance=futureCan)
     self.assertEqual(futureCan.status, "cancelled")
     self.assertEqual(futureCan.status_text,
                      "This event has been cancelled.")
Example #15
0
 def _setUpNovaSubsite(self):
     main = getPage("/home/")
     home = Page(slug="nova", title="Nova Homepage")
     main.add_child(instance=home)
     home.save_revision().publish()
     activities = Page(slug="activities", title="Nova Activities")
     home.add_child(instance=activities)
     activities.save_revision().publish()
     Site.objects.create(hostname='nova.joy.test',
                         root_page_id=home.id,
                         is_default_site=False)
     events = CalendarPage(owner=self.user,
                           slug="nova-events",
                           title="Nova Events")
     home.add_child(instance=events)
     events.save_revision().publish()
     committee = RecurringEventPage(owner=self.user,
                                    slug="executive-meeting",
                                    title="Executive Committee Meeting",
                                    repeat=Recurrence(dtstart=dt.date(
                                        1984, 8, 5),
                                                      freq=WEEKLY,
                                                      byweekday=[TH]),
                                    time_from=dt.time(13),
                                    time_to=dt.time(15))
     events.add_child(instance=committee)
     committee.save_revision().publish()
     event = SimpleEventPage(owner=self.user,
                             slug="rubbish-blitz",
                             title="Rubbish Blitz",
                             date=dt.date(1984, 9, 13),
                             time_from=dt.time(12, 30),
                             time_to=dt.time(17))
     events.add_child(instance=event)
     event.save_revision().publish()
     cancellation = CancellationPage(
         owner=self.user,
         slug="1984-09-13-cancellation",
         title="Cancellation for Thursday 13th of September",
         overrides=committee,
         except_date=dt.date(1984, 9, 13),
         cancellation_title="Meeting Cancelled",
         cancellation_details="The committee will be at "
         "the working bee")
     committee.add_child(instance=cancellation)
     cancellation.save_revision().publish()
Example #16
0
 def testLastOccurenceCancelledStatus(self):
     event = RecurringEventPage(owner = self.user,
                                slug  = "breakfast2",
                                title = "Breakfast-in-bed",
                                repeat = Recurrence(dtstart=dt.date(2008,2,1),
                                                    until=dt.date(2008,5,9),
                                                    freq=WEEKLY,
                                                    byweekday=[SA,SU]),
                                time_from = dt.time(8),
                                time_to   = dt.time(9))
     self.calendar.add_child(instance=event)
     cancellation = CancellationPage(owner = self.user,
                                     overrides = event,
                                     except_date = dt.date(2008, 5, 4),
                                     cancellation_title   = "Fire in the kitchen",
                                     cancellation_details = "The bacon fat is burning")
     event.add_child(instance=cancellation)
     self.assertEqual(event.status, "finished")
Example #17
0
 def testGetEventsByDay(self):
     hiddenCancellation = CancellationPage(owner=self.user,
                                           overrides=self.event,
                                           except_date=dt.date(1989, 2, 13))
     self.event.add_child(instance=hiddenCancellation)
     events = RecurringEventPage.events.byDay(dt.date(1989, 2, 1),
                                              dt.date(1989, 2, 28))
     self.assertEqual(len(events), 28)
     evod1 = events[0]
     self.assertEqual(evod1.date, dt.date(1989, 2, 1))
     self.assertEqual(len(evod1.days_events), 1)
     self.assertEqual(len(evod1.continuing_events), 0)
     title, page, url = evod1.days_events[0]
     self.assertEqual(title, "Meeting Cancelled")
     self.assertIs(type(page), CancellationPage)
     evod2 = events[12]
     self.assertEqual(evod2.date, dt.date(1989, 2, 13))
     self.assertEqual(len(evod2.days_events), 0)
     self.assertEqual(len(evod2.continuing_events), 0)
Example #18
0
 def _setUpMainSite(self):
     Site.objects.filter(is_default_site=True).update(hostname="joy.test")
     home = getPage("/home/")
     events = CalendarPage(owner=self.user, slug="events", title="Events")
     home.add_child(instance=events)
     events.save_revision().publish()
     chess = GroupPage(slug="chess-club", title="Chess Club")
     home.add_child(instance=chess)
     chess.save_revision().publish()
     event = RecurringEventPage(owner=self.user,
                                slug="lunchtime-matches",
                                title="Lunchtime Chess Matches",
                                repeat=Recurrence(dtstart=dt.date(
                                    1984, 8, 5),
                                                  freq=WEEKLY,
                                                  byweekday=[MO, WE, FR]),
                                time_from=dt.time(12),
                                time_to=dt.time(13))
     chess.add_child(instance=event)
     event.save_revision().publish()
     cancellation = CancellationPage(
         owner=self.user,
         slug="1984-10-01-cancellation",
         title="Cancellation for Monday 1st of October",
         overrides=event,
         except_date=dt.date(1984, 10, 1),
         cancellation_title="No Chess Club Today")
     event.add_child(instance=cancellation)
     cancellation.save_revision().publish()
     postponement = PostponementPage(
         owner=self.user,
         slug="1984-10-03-postponement",
         title="Postponement for Wednesday 3rd of October",
         overrides=event,
         except_date=dt.date(1984, 10, 3),
         cancellation_title="",
         postponement_title="Early Morning Matches",
         date=dt.date(1984, 10, 4),
         time_from=dt.time(7, 30),
         time_to=dt.time(8, 30))
     event.add_child(instance=postponement)
     postponement.save_revision().publish()
     event = RecurringEventPage(owner=self.user,
                                slug="flea-market",
                                title="Flea Market",
                                repeat=Recurrence(dtstart=dt.date(
                                    1984, 7, 1),
                                                  freq=YEARLY,
                                                  byweekday=[SA(1),
                                                             SA(3)],
                                                  bymonth=range(2, 12)),
                                time_from=dt.time(8),
                                time_to=dt.time(13))
     events.add_child(instance=event)
     event.save_revision().publish()
     event = RecurringEventPage(owner=self.user,
                                slug="drama-practice",
                                title="Drama Group",
                                repeat=Recurrence(dtstart=dt.date(
                                    1984, 8, 14),
                                                  freq=WEEKLY,
                                                  byweekday=[TH],
                                                  interval=2),
                                time_from=dt.time(17))
     events.add_child(instance=event)
     event.save_revision().publish()
     event = SimpleEventPage(owner=self.user,
                             slug="public-lecture3",
                             title="The Human Environment",
                             date=dt.date(1984, 9, 14),
                             time_from=dt.time(19),
                             location="Lecture Hall C")
     events.add_child(instance=event)
     event.save_revision().publish()
Example #19
0
 def testCopyFieldsFromParent(self):
     self.assertEqual(self.event.next_date, dt.date(1989, 10, 3))
     cancellation = CancellationPage(owner=self.user)
     cancellation._copyFieldsFromParent(self.event)
     self.assertEqual(cancellation.overrides, self.event)
     self.assertEqual(cancellation.except_date, dt.date(1989, 10, 2))
Example #20
0
    def setUp(self):
        self.home = Page.objects.get(slug='home')
        self.user = User.objects.create_user('i', '*****@*****.**', 's3cr3t')
        self.request = RequestFactory().get("/test")
        self.request.user = self.user
        self.request.session = {}
        self.calendar = GeneralCalendarPage(owner = self.user,
                                            slug  = "events",
                                            title = "Events")
        self.home.add_child(instance=self.calendar)
        self.group = GroupPage(slug = "initech", title = "Initech Corporation")
        self.home.add_child(instance=self.group)

        self.show = SimpleEventPage(owner = self.user,
                                    slug   = "pet-show",
                                    title  = "Pet Show",
                                    date      = dt.date(2013,1,5),
                                    time_from = dt.time(11),
                                    time_to   = dt.time(17,30),
                                    uid       = "29daefed-fed1-4e47-9408-43ec9b06a06d")
        self.calendar.add_child(instance=self.show)

        GROUPS = PageViewRestriction.GROUPS
        self.friends = Group.objects.create(name = "Friends")
        self.rendezvous = SimpleEventPage(owner = self.user,
                                          slug   = "rendezvous",
                                          title  = "Private Rendezvous",
                                          date      = dt.date(2013,1,10),
                                          uid       = "80af64e7-84e6-40d9-8b4f-7edf92aab9f7")
        self.calendar.add_child(instance=self.rendezvous)
        self.rendezvous.save_revision().publish()
        restriction = PageViewRestriction.objects.create(restriction_type = GROUPS,
                                                         page = self.rendezvous)
        restriction.groups.set([self.friends])
        restriction.save()

        self.party = MultidayEventPage(owner = self.user,
                                       slug  = "allnighter",
                                       title = "All Night",
                                       date_from = dt.date(2012,12,31),
                                       date_to   = dt.date(2013,1,1),
                                       time_from = dt.time(23),
                                       time_to   = dt.time(3),
                                       uid       = "initiative+technology")
        self.calendar.add_child(instance=self.party)

        self.standup = RecurringEventPage(slug   = "test-meeting",
                                          title  = "Test Meeting",
                                          repeat = Recurrence(dtstart=dt.date(2013,1,1),
                                                              until=dt.date(2013,5,31),
                                                              freq=WEEKLY,
                                                              byweekday=[MO,WE,FR]),
                                          time_from = dt.time(13,30),
                                          time_to   = dt.time(16),
                                          uid       = "initiative+technology")
        self.group.add_child(instance=self.standup)

        self.postponement = PostponementPage(owner = self.user,
                                             slug  = "2013-01-09-postponement",
                                             title = "Postponement for Wednesday 16th of October",
                                             overrides = self.standup,
                                             except_date = dt.date(2013,1,16),
                                             cancellation_title   = "Meeting Postponed",
                                             cancellation_details =
                                                 "The meeting has been postponed until tomorrow",
                                             postponement_title   = "A Meeting",
                                             date      = dt.date(2013,1,17),
                                             time_from = dt.time(13),
                                             time_to   = dt.time(16,30),
                                             details   = "Yes a test meeting on a Thursday")
        self.standup.add_child(instance=self.postponement)

        cancelTuesday = CancellationPage(owner = self.user,
                                         slug  = "2013-01-01-cancellation",
                                         title = "CancellationPage for Tuesday 1st of January",
                                         overrides = self.standup,
                                         except_date = dt.date(2013,1,1),
                                         cancellation_title   = "Meeting Cancelled")
        self.standup.add_child(instance=cancelTuesday)
Example #21
0
 def testBindWithoutForm25(self):
     cancellation = CancellationPage(owner=self.user,
                                     except_date=dt.date(2019, 1, 21))
     panel = ExceptionDatePanel('except_date', classname='full-width')
     panel = panel.bind_to(instance=cancellation)
     self.assertIsNone(panel.form)