Ejemplo n.º 1
0
    def testDate(self):
        err = False
        testTerm = FreeTerm(room=self.room, date=(self.date - datetime.timedelta(days=1)), begin=10, end=15)

        try:
            testTerm.clean()
        except ValidationError:
            err = True
        self.assertTrue(err)
Ejemplo n.º 2
0
    def testHour(self):
        err = False

        testTerm = FreeTerm(room=self.room, date=self.date, begin=-3, end=5)
        try:
            testTerm.clean()
        except ValidationError:
            err = True
        self.assertTrue(err)

        err = False

        testTerm = FreeTerm(room=self.room, date=self.date, begin=10, end=9)
        try:
            testTerm.clean()
        except ValidationError:
            err = True
        self.assertTrue(err)

        err = True

        testTerm = FreeTerm(room=self.room, date=self.date, begin=10, end=15)
        try:
            testTerm.clean()
        except ValidationError:
            err = False
        self.assertTrue(err)