Esempio n. 1
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")
Esempio n. 2
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)
Esempio n. 3
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)
Esempio n. 4
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)