Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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)
Пример #5
0
 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)
Пример #6
0
 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)
Пример #7
0
 def test_findAll_books(self):
     tester = app.test_client(self)
     r = tester.get("{}/{}".format(TestWishListTest.BOOKS_URL, "all"))
     self.assertEqual(r.status_code, 200)
Пример #8
0
 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)
Пример #9
0
 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)
Пример #10
0
 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)
Пример #11
0
 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)