def test1stOffsetNeg1(self): rr = Recurrence(dtstart=dt.date(2009, 1, 1), freq=MONTHLY, bymonthday=1, until=dt.date(2010, 5, 1)) self.assertEqual(rr._getWhen(-1), "The last day of the month (until 30 April 2010)")
def test2ndAnd4thFriOffsetNeg1(self): rr = Recurrence(dtstart=dt.date(2009, 1, 1), freq=MONTHLY, byweekday=[FR(2), FR(4)]) self.assertEqual( rr._getWhen(-1), "The Thursday before the second Friday and " "Thursday before the fourth Friday of the month")
def test1stJanAprMayOffsetNeg1(self): rr = Recurrence(dtstart=dt.date(2009, 1, 1), freq=YEARLY, bymonthday=1, bymonth=[1, 4, 5]) self.assertEqual(rr._getWhen(-1), "The last day of December, March and April")
def test1stAndLastOffsetNeg1(self): rr = Recurrence(dtstart=dt.date(2009, 1, 1), freq=MONTHLY, bymonthday=[1, -1]) self.assertEqual( rr._getWhen(-1), "The day before the first and the last day of the month")
def testRoundtrip(self): rrStr = "DTSTART:20151001\n" \ "RRULE:FREQ=MONTHLY;WKST=SU;BYDAY=-1SU;BYMONTH=1,2,3,4,5,6,7,8,9,10,11" self.assertEqual(repr(Recurrence(rrStr)), rrStr) rrStr = "DTSTART:20141001\n" \ "RRULE:FREQ=MONTHLY;WKST=SU;UNTIL=20141001;BYMONTHDAY=1,-1" # first&last self.assertEqual(repr(Recurrence(rrStr)), rrStr)
def testLastJulAugSepDecOffset1(self): rr = Recurrence(dtstart=dt.date(2009, 1, 1), freq=YEARLY, bymonthday=-1, bymonth=[7,8,9,12]) self.assertEqual(rr._getWhen(1), "The first day of August, September, October and January")
def testLastSatSeptEvery2Years(self): rr = Recurrence(dtstart=dt.date(2018, 9, 29), interval=2, freq=YEARLY, byweekday=SA(-1), bymonth=9) self.assertEqual(rr._getWhen(0, numDays=5), "The last Saturday of September, every 2 years for 5 days")
def testRepr(self): rr = Recurrence(dtstart=dt.date(2009, 1, 1), freq=WEEKLY, count=9, byweekday=[MO,TU,WE,TH,FR]) self.assertEqual(repr(rr), "DTSTART:20090101\n" "RRULE:FREQ=WEEKLY;WKST=SU;COUNT=9;BYDAY=MO,TU,WE,TH,FR") self.assertEqual(rr.count, rr.getCount()) rr = Recurrence(dtstart=dt.date(2011, 1, 1), freq=DAILY, interval=2, until=dt.date(2011,1,11)) self.assertEqual(repr(rr), "DTSTART:20110101\n" "RRULE:FREQ=DAILY;INTERVAL=2;WKST=SU;UNTIL=20110111") rr = Recurrence(dtstart=dt.date(2012, 1, 1), freq=YEARLY, bymonth=[1,2], byweekday=range(7), until=dt.date(2012,1,31)) self.assertEqual(repr(rr), "DTSTART:20120101\n" "RRULE:FREQ=YEARLY;WKST=SU;UNTIL=20120131;" "BYDAY=MO,TU,WE,TH,FR,SA,SU;BYMONTH=1,2") rr = Recurrence(dtstart=dt.date(2015, 10, 1), freq=MONTHLY, bymonth=range(1,12), byweekday=[(SU(-1))]) self.assertEqual(repr(rr), "DTSTART:20151001\n" "RRULE:FREQ=MONTHLY;WKST=SU;BYDAY=-1SU;BYMONTH=1,2,3,4,5,6,7,8,9,10,11")
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.request.site = Site.objects.get(is_default_site=True) self.group = GroupPage(slug="initech", title="Initech Corporation") self.home.add_child(instance=self.group) 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)
def setUp(self): self.home = Page.objects.get(slug='home') self.user = User.objects.create_user('j', '*****@*****.**', 's3(r3t') self.calendar = GeneralCalendarPage(owner=self.user, slug="events", title="Events") self.home.add_child(instance=self.calendar) self.calendar.save_revision().publish() self.event = MultidayRecurringEventPage( slug="test-session", title="Test Session", repeat=Recurrence(dtstart=dt.date(1990, 1, 2), freq=WEEKLY, byweekday=[TU], until=dt.date(1990, 3, 29)), num_days=3, time_from=dt.time(10), time_to=dt.time(16, 30)) self.calendar.add_child(instance=self.event) self.postponement = RescheduleMultidayEventPage( owner=self.user, overrides=self.event, except_date=dt.date(1990, 1, 9), postponement_title="Delayed Start Session", date=dt.date(1990, 1, 9), num_days=3, time_from=dt.time(13), time_to=dt.time(19, 30)) self.event.add_child(instance=self.postponement) self.postponement.save_revision().publish()
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 _setUpVeterisSubsite(self): main = getPage("/home/") home = Page(slug="veteris", title="Veteris Council") main.add_child(instance=home) home.save_revision().publish() activities = Page(slug="activities", title="Veteris Calendar") home.add_child(instance=activities) activities.save_revision().publish() Site.objects.create(hostname='veteris.joy.test', root_page_id=home.id, is_default_site=False) events = CalendarPage(owner=self.user, slug="veteris-events", title="Veteris Events") home.add_child(instance=events) events.save_revision().publish() committee = RecurringEventPage(owner=self.user, slug="veteris-committee", title="Committee Meeting", repeat=Recurrence( dtstart=dt.date(1970, 1, 5), freq=MONTHLY, byweekday=[MO], until=dt.date(1978, 8, 7)), time_from=dt.time(14), time_to=dt.time(15)) events.add_child(instance=committee) committee.save_revision().publish()
def testParse(self): rr = Recurrence( "DTSTART:20090101\n" "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=MO,TU,WE,TH,FR;COUNT=9") self.assertEqual(rr.dtstart, dt.date(2009, 1, 1)) self.assertEqual(rr.count, 9) self.assertCountEqual(rr.byweekday, [MO, TU, WE, TH, FR])
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")
def testFromPage(self): page = RecurringEventPage(owner=self.user, slug="lunch-and-code", title="Lunch and Code", details="What we'll do really depends on " "what the group feels is useful, " "some ideas are:\n" "- Providing feedback on past, or " "in progress, projects\n" "- Pair programming\n" "- Coding\n", repeat=Recurrence(dtstart=dt.date( 2017, 3, 15), freq=MONTHLY, byweekday=[FR(-1)]), time_from=dt.time(12), time_to=dt.time(13), tz=pytz.timezone("Pacific/Auckland"), location="70 Molesworth Street, Wellington") self.calendar.add_child(instance=page) page.save_revision().publish() gev = RecurringGEvent.fromPage(page) self.assertEqual( gev.url, "http://www.google.com/calendar/event?" "action=TEMPLATE&" "text=Lunch+and+Code&" "details=What+we%27ll+do+really+depends+on+what+the+" "group+feels+is+useful%2C+some+ideas+are%3A%0A" "-+Providing+feedback+on+past%2C+or+in+progress%2C+projects%0A" "-+Pair+programming%0A-+Coding%0A&" "location=70+Molesworth+Street%2C+Wellington&" "dates=20170331T120000%2F20170331T130000&" "ctz=Pacific%2FAuckland&" "recur=RRULE%3AFREQ%3DMONTHLY%3BWKST%3DSU%3BBYDAY%3D-1FR")
def setUp(self): translation.activate('de') self.home = Page.objects.get(slug='home') self.user = User.objects.create_user('i', '*****@*****.**', 's3(r3t') self.calendar = CalendarPage(owner=self.user, slug="ereignisse", title="Ereignisse") self.home.add_child(instance=self.calendar) self.calendar.save_revision().publish() self.event = RecurringEventPage(slug="meeting", title="Testen Sie Meeting", repeat=Recurrence( dtstart=dt.date(1988, 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.info = ExtraInfoPage(owner=self.user, overrides=self.event, except_date=dt.date(1999, 1, 5), extra_title="Freitag", extra_information="Besonderer Freitag") self.event.add_child(instance=self.info) self.info.save_revision().publish()
def setUp(self): if WagtailVersion > (2, 13, 0): self.FIELD_CONTENT = """ <div data-contentpath="num_days"> {} {} </div> """.format(self.FIELDSET_CONTENT, self.COMMENT_CONTROL_CONTENT) else: self.FIELD_CONTENT = self.FIELDSET_CONTENT self.maxDiff = None self.home = getPage("/home/") self.user = User.objects.create_superuser('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="leaders-meeting", title="Leaders' Meeting", repeat=Recurrence(dtstart=dt.date( 2016, 2, 16), freq=MONTHLY, byweekday=[TU(3)]), time_from=dt.time(19), tz="Asia/Tokyo") self.calendar.add_child(instance=self.event) self.event.save_revision().publish() Form = get_form_for_model(RecurringEventPage, form_class=RecurringEventPageForm) self.form = Form(instance=self.event, parent_page=self.calendar)
def setUp(self): imgFile = get_test_image_file() imgFile.name = "logo.png" self.img = Image.objects.create(title="Logo", file=imgFile) imgName = os.path.splitext(os.path.basename(self.img.file.name))[0] self.rendName = "{}.width-350.format-png.png".format(imgName) Site.objects.update(hostname="joy.test") self.home = Page.objects.get(slug='home') self.user = User.objects.create_user('i', '*****@*****.**', 's3(R3t') 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() self.event = RecurringEventPage(owner = self.user, slug = "workshop", title = "Workshop", image = self.img, repeat = Recurrence(dtstart=dt.date(2017,1,1), freq=MONTHLY, byweekday=[TU(1)], until=dt.date(2017,12,26))) self.calendar.add_child(instance=self.event) self.event.save_revision().publish() self.handler = RssHandler()
def testGetUpcomingEvents(self): event = RecurringEventPage(slug="lemon", title="Lemonade Stand", repeat=Recurrence(dtstart=dt.date( 2021, 1, 1), freq=WEEKLY, byweekday=[FR]), time_from=dt.time(11), time_to=dt.time(13)) self.calendar.add_child(instance=event) shutdown = ExtCancellationPage(owner=self.user, overrides=event, cancelled_from_date=dt.date( 2021, 2, 13), cancellation_title="Gone fishing") event.add_child(instance=shutdown) shutdown.save_revision().publish() events = ExtCancellationPage.events.exclude(cancellation_title="") \ .upcoming().this() \ .descendant_of(event) self.assertEqual(len(events), 1) title, page, url = events[0] self.assertEqual(title, "Gone fishing") self.assertEqual(page._future_datetime_from, datetimetz(2021, 2, 19, 11, 0)) self.assertEqual(url, "/events/lemon/2021-02-13--cancellation/")
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(1988, 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.info = ExtraInfoPage( owner=self.user, slug="1988-11-11-extra-info", title="Extra Information for Friday 11th of November", overrides=self.event, except_date=dt.date(1988, 11, 11), extra_title="System Demo", extra_information="<h3>System Demo</h3>") self.event.add_child(instance=self.info) self.info.save_revision().publish()
def testPastDt(self): lugDt = self.event._past_datetime_from self.assertEqual(lugDt.time(), dt.time(18, 30)) self.assertEqual(lugDt.date().weekday(), 1) self.assertLess(lugDt.date().day, 8) movieNight = RecurringEventPage(owner=self.user, slug="movies", title="Movies", repeat=Recurrence(dtstart=dt.date( 2005, 2, 1), freq=WEEKLY, byweekday=[ TH, ]), time_from=dt.time(20, 15), time_to=dt.time(21, 30)) self.calendar.add_child(instance=movieNight) now = timezone.localtime() myday = now.date() startTime = dt.time(20, 15) if now.time() < startTime: myday -= dt.timedelta(days=1) thursday = myday - dt.timedelta(days=(myday.weekday() - 3) % 7) self.assertEqual(movieNight._past_datetime_from, datetimetz(thursday, startTime))
def testPostponementOccurenceLast(self): request = RequestFactory().get("/test") request.user = self.user request.session = {} event = RecurringEventPage(owner=self.user, slug="breakfast3", 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) postponement = PostponementPage( owner=self.user, overrides=event, except_date=dt.date(2008, 5, 3), postponement_title="Breakfast in Bed owed from May", date=dt.date(2008, 5, 24), time_from=dt.time(8), time_to=dt.time(9)) event.add_child(instance=postponement) self.assertIsNone(event.status) self.assertEqual( event._nextOn(request), '<a class="inline-link" href="/events/breakfast3/2008-05-03-postponement/">Saturday 24th of May at 8am</a>' )
def setUp(self): self.home = Page.objects.get(slug='home') self.user = User.objects.create_user('j', '*****@*****.**', 's3(r3t') self.calendar = GeneralCalendarPage(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(1990, 1, 1), freq=WEEKLY, byweekday=[MO, WE, FR]), time_from=dt.time(13, 30), time_to=dt.time(16), tz=pytz.timezone("US/Eastern")) self.calendar.add_child(instance=self.event) self.postponement = PostponementPage( owner=self.user, overrides=self.event, postponement_title="Delayed Meeting", except_date=dt.date(1990, 10, 10), date=dt.date(1990, 10, 11), time_from=dt.time(13), time_to=dt.time(16, 30)) self.event.add_child(instance=self.postponement) self.postponement.save_revision().publish()
def testServeRecurring(self): page = RecurringEventPage(owner=self.user, slug="lunch-and-code", title="Lunch and Code", repeat=Recurrence(dtstart=dt.date( 2017, 3, 15), freq=MONTHLY, byweekday=[FR(-1)]), time_from=dt.time(12), time_to=dt.time(13), tz=pytz.timezone("Pacific/Auckland"), location="70 Molesworth Street, Wellington") self.calendar.add_child(instance=page) page.save_revision().publish() response = self.handler.serve( page, self._getRequest("/events/lunch-and-code/" "?format=google")) self.assertEqual(response.status_code, 302) self.assertEqual( response.url, "http://www.google.com/calendar/event?action=TEMPLATE&" "text=Lunch+and+Code&" "location=70+Molesworth+Street%2C+Wellington&" "dates=20170331T120000%2F20170331T130000&" "ctz=Pacific%2FAuckland&" "recur=RRULE%3AFREQ%3DMONTHLY%3BWKST%3DSU%3BBYDAY%3D-1FR")
def setUp(self): self.home = Page.objects.get(slug='home') self.user = User.objects.create_user('j', '*****@*****.**', 's3(r3t') 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.calendar.save_revision().publish() self.event = RecurringEventPage(slug="test-meeting", title="Test Meeting", repeat=Recurrence( dtstart=dt.date(1990, 1, 1), freq=WEEKLY, byweekday=[MO, WE, FR]), time_from=dt.time(13, 30), time_to=dt.time(16)) self.calendar.add_child(instance=self.event) self.postponement = PostponementPage( owner=self.user, overrides=self.event, except_date=dt.date(1990, 10, 10), cancellation_title="Meeting Postponed", cancellation_details= "The meeting has been postponed until tomorrow", postponement_title="A Meeting", date=dt.date(1990, 10, 11), time_from=dt.time(13), time_to=dt.time(16, 30), details="Yes a test meeting on a Thursday") self.event.add_child(instance=self.postponement) self.postponement.save_revision().publish()
def testServeException(self): event = RecurringEventPage(slug="test-meeting", title="Test Meeting", repeat=Recurrence(dtstart=dt.date( 1988, 1, 1), freq=WEEKLY, byweekday=[MO, WE, FR]), time_from=dt.time(13), time_to=dt.time(15, 30)) self.calendar.add_child(instance=event) event.save_revision().publish() info = ExtraInfoPage(owner=self.user, overrides=event, except_date=dt.date(1988, 11, 11), extra_title="System Demo", extra_information="<h3>System Demo</h3>") event.add_child(instance=info) info.save_revision().publish() response = self.handler.serve( info, self._getRequest("/events/test-meeting/1998-11-11/extra-info/" "?format=google")) self.assertEqual(response.status_code, 302) self.assertEqual( response.url, "http://www.google.com/calendar/event?action=TEMPLATE&" "text=Test+Meeting&" "dates=19880101T130000%2F19880101T153000&" "ctz=Asia%2FTokyo&" "recur=RRULE%3AFREQ%3DWEEKLY%3BWKST%3DSU%3BBYDAY%3DMO%2CWE%2CFR")
def testFromPage(self): page = RecurringEventPage( owner=self.user, slug="code-for-boston", title="Code for Boston", repeat=Recurrence(dtstart=dt.date(2017, 1, 1), freq=WEEKLY, byweekday=[TU]), time_from=dt.time(19), time_to=dt.time(21, 30), tz=pytz.timezone("US/Eastern"), location="4th Floor, 1 Broadway, Cambridge, MA") self.calendar.add_child(instance=page) page.save_revision().publish() vev = RecurringVEvent.fromPage(page) vev.set('UID', "this-is-not-a-unique-identifier") codeForBoston = b"\r\n".join([ b"BEGIN:VEVENT", b"SUMMARY:Code for Boston", b"DTSTART;TZID=US/Eastern:20170103T190000", b"DTEND;TZID=US/Eastern:20170103T213000", b"DTSTAMP:20170815T000000Z", b"UID:this-is-not-a-unique-identifier", b"SEQUENCE:1", b"RRULE:FREQ=WEEKLY;BYDAY=TU;WKST=SU", b"CREATED:20170815T000000Z", b"DESCRIPTION:", b"LAST-MODIFIED:20170815T000000Z", b"LOCATION:4th Floor\\, 1 Broadway\\, Cambridge\\, MA", b"URL:http://joy.test/events/code-for-boston/", b"END:VEVENT", b"" ]) self.assertEqual(vev.to_ical(), codeForBoston)
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(2010, 1, 1), freq=WEEKLY, byweekday=[MO, WE, FR]), time_from=dt.time(13), time_to=dt.time(14, 30)) self.calendar.add_child(instance=self.event) self.shutdown = ExtCancellationPage( owner=self.user, overrides=self.event, cancelled_from_date=dt.date(2020, 3, 20), cancelled_to_date=dt.date(2020, 6, 1), cancellation_title="No Meeting during Shutdown") self.event.add_child(instance=self.shutdown) self.shutdown.save_revision().publish()
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), holidays=self.calendar.holidays) self.calendar.add_child(instance=self.event) self.closedHols = ClosedForHolidaysPage( owner=self.user, overrides=self.event, all_holidays=True, holidays=self.calendar.holidays) self.event.add_child(instance=self.closedHols) self.closedHols.save_revision().publish()
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="schedule", title="Schedule") self.home.add_child(instance=self.calendar) self.calendar.save_revision().publish() self.event = MultidayRecurringEventPage( slug="test-session", title="Test Session", repeat=Recurrence(dtstart=dt.date(2018, 1, 8), freq=WEEKLY, byweekday=[MO], until=dt.date(2018, 4, 25)), num_days=3, time_from=dt.time(10), time_to=dt.time(12, 30)) self.calendar.add_child(instance=self.event) self.info = ExtraInfoPage(owner=self.user, overrides=self.event, except_date=dt.date(2018, 2, 12), extra_title="System Demo", extra_information="<h3>System Demo</h3>") self.event.add_child(instance=self.info) self.info.save_revision().publish()