Exemplo n.º 1
0
 def test_create(self):
     current_count = Room.all().count()
     Room.create("New Room", 'living_space')
     self.assertEqual(Room.all().count(), current_count + 1)
Exemplo n.º 2
0
 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())
Exemplo n.º 3
0
 def test_save(self):
     new_room = Room(name="New Name")
     new_room.save()
     self.assertIn(new_room, Room.all())
Exemplo n.º 4
0
 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))