Ejemplo n.º 1
0
    def test_ends_right_at_the_end_of_period(self):
        absenses = BusyPeriods(self.teacher.busy_periods)

        self.assertTrue(
            absenses.is_present(
                start=self.tzdatetime(2032, 12, 5, 13, 00),
                end=self.tzdatetime(2032, 12, 5, 13, 30),
            ))
Ejemplo n.º 2
0
    def test_starts_right_at_the_beginning_of_the_period(self):
        absenses = BusyPeriods(self.teacher.busy_periods)

        self.assertFalse(
            absenses.is_present(
                start=self.tzdatetime(2032, 12, 5, 13, 30),
                end=self.tzdatetime(2032, 12, 5, 13, 45),
            ))
Ejemplo n.º 3
0
    def test_outside_period(self):
        absenses = BusyPeriods(self.teacher.busy_periods)

        self.assertTrue(
            absenses.is_present(
                start=self.tzdatetime(2032, 12, 5, 15, 40),
                end=self.tzdatetime(2032, 12, 5, 19, 45),
            ))
Ejemplo n.º 4
0
    def test_start_outside_period(self):
        absenses = BusyPeriods(self.teacher.busy_periods)

        self.assertFalse(
            absenses.is_present(
                start=self.tzdatetime(2032, 12, 5, 13, 00),
                end=self.tzdatetime(2032, 12, 5, 14, 00),
            ))
Ejemplo n.º 5
0
    def test_within_period(self):
        absenses = BusyPeriods(self.teacher.busy_periods)

        self.assertFalse(
            absenses.is_present(
                start=self.tzdatetime(2032, 12, 5, 13, 40),
                end=self.tzdatetime(2032, 12, 5, 13, 45),
            ))