def test_add_car_seat(self): controller = Controller() controller.login("*****@*****.**", "password") controller.add_car_seat("CD80D789SD8090S", "Graco - Extend to Fit") self.assertEqual(controller.active_user.car_seats[1].serial_number, "CD80D789SD8090S") self.assertEqual(controller.active_user.car_seats[1].model, "Graco - Extend to Fit")
def test_delete_car_seat(self): controller = Controller() controller.login("*****@*****.**", "password") controller.delete_car_seat("CD80D789SD8090S") self.assertEqual(len(controller.active_user.car_seats), 1)
def test_get_user_car_seats(self): controller = Controller() controller.login("*****@*****.**", "password") self.assertIsNotNone(controller.active_user.car_seats) self.assertEqual(controller.active_user.car_seats[0].serial_number, "123ABC")
def test_login(self): controller = Controller() loggedIn = controller.login("*****@*****.**", "p@ssw0rd") self.assertEqual(loggedIn, 1) self.assertIsNotNone(controller.active_user) self.assertEqual(controller.active_user.email, "*****@*****.**")