Пример #1
0
    def testlink(self):
        r = Room(room_id=1234)
        r.save()

        d = datetime.now()

        h = History(link=1234,add_time = d,room = r)
        h.save()
        self.assertRaises(ValueError,h.save())
Пример #2
0
    def test_add_time(self):
        r = Room(room_id=1234)
        r.save()

        d = "Hello"

        h = History(link="1234",add_time = d,room = r)
        with self.assertRaises(ValidationError):
            h.save()
Пример #3
0
    def testRoom(self):
        r = Room(room_id=1234)
        r.save()

        d = datetime.now()

        h = History(link="test",add_time = d,room = r)
        h.save()
        self.assertTrue(1 == 1)