def test_create(self): current_count = Room.all().count() Room.create("New Room", 'living_space') self.assertEqual(Room.all().count(), current_count + 1)
def test_all(self): self.assertEqual(1, Room.all().count()) new_room = Room(name="New Name") new_room.save() self.assertEquals(2, Room.all().count())
def test_save(self): new_room = Room(name="New Name") new_room.save() self.assertIn(new_room, Room.all())
def test_create_multiple(self): current_count = Room.all().count() new_rooms = ["office1", "office2", "office3"] Room.create_multiple("office", new_rooms) self.assertEqual(Room.all().count(), current_count + len(new_rooms))