def test_delete_wishlist(self): tester = app.test_client(self) r = tester.delete("{}/{}".format(TestWishListTest.WISHLIST_URL, "delete?wishlist_id=1")) self.assertTrue('Book has been removed from Wish List.', r.data)
def test_find_user_wishlist(self): tester = app.test_client(self) r = tester.get("{}/{}".format(TestWishListTest.WISHLIST_URL, "user?user_id=1")) self.assertEqual(r.status_code, 200)
def test_create_wishlist(self): tester = app.test_client(self) r = tester.post("{}/{}".format(TestWishListTest.WISHLIST_URL, "create?user_id=1&book_id=1")) self.assertTrue('New book added to Wish List.', r.data)
def test_update_wishlist(self): tester = app.test_client(self) r = tester.put("{}/{}".format(TestWishListTest.BOOKS_URL, "update?wishlist_id=1&user_id=1&book_id=2")) self.assertTrue('Wish List has been updated.', r.data)
def test_update_books(self): tester = app.test_client(self) r = tester.put("{}/{}".format(TestWishListTest.BOOKS_URL, "update?title=Origin&author=Dan " "Brown&isbn=9780525434290&date_of_publication=10/3" "/2007")) self.assertTrue('Updated book information.', r.data)
def test_delete_books(self): tester = app.test_client(self) r = tester.delete("{}/{}".format(TestWishListTest.BOOKS_URL, "delete?book_id=1")) self.assertTrue('Book successfully deleted.', r.data)
def test_findAll_books(self): tester = app.test_client(self) r = tester.get("{}/{}".format(TestWishListTest.BOOKS_URL, "all")) self.assertEqual(r.status_code, 200)
def test_create_books(self): tester = app.test_client(self) r = tester.post("{}/{}".format(TestWishListTest.BOOKS_URL, "create?title=Origin&author=Dan " "Brown&isbn=9789752123267&date_of_publication=10/3" "/2007")) self.assertTrue('New book created.', r.data)
def test_delete_users(self): tester = app.test_client(self) r = tester.delete("{}/{}".format(TestWishListTest.USERS_URL, "delete?user_id=1")) self.assertTrue('User successfully deleted.', r.data)
def test_update_users(self): tester = app.test_client(self) r = tester.put("{}/{}".format(TestWishListTest.USERS_URL, "update?user_id=1&first_name=Bob&last_name=Test&" "[email protected]&password=12345")) self.assertTrue('Updated user information.', r.data)
def test_create_users(self): tester = app.test_client(self) r = tester.post("{}/{}".format(TestWishListTest.USERS_URL, "create?first_name=Bob&last_name=Test&email=bob" "@test.com&password=password")) self.assertTrue('New user created.', r.data)