Esempio n. 1
0
 def test_duplicate_category(self):
     category = Category("Sci-fi")
     db.session.add(category)
     db.session.commit()
     self.args['category_name'] = 'Sci-fi'
     json_result = rating_book_request_impl(self.args)
     assert "error" not in json_result
Esempio n. 2
0
 def test_duplicate_category(self):
     category = Category("Sci-fi")
     db.session.add(category)
     db.session.commit()
     self.args["category_name"] = "Sci-fi"
     json_result = rating_book_request_impl(self.args)
     assert "error" not in json_result
Esempio n. 3
0
 def test_duplicate_author(self):
     author = Author("Rafael")
     db.session.add(author)
     db.session.commit()
     self.args['author_name'] = 'Rafael'
     json_result = rating_book_request_impl(self.args)
     assert "error" not in json_result
Esempio n. 4
0
 def test_duplicate_author(self):
     author = Author("Rafael")
     db.session.add(author)
     db.session.commit()
     self.args["author_name"] = "Rafael"
     json_result = rating_book_request_impl(self.args)
     assert "error" not in json_result
Esempio n. 5
0
 def test_invalid_under_rating(self):
     self.args['rating'] = -1
     json_result = rating_book_request_impl(self.args)
     assert "error" in json_result
Esempio n. 6
0
 def test_invalid_book_name(self):
     self.args['book_name'] = None
     json_result = rating_book_request_impl(self.args)
     assert "error" in json_result
Esempio n. 7
0
 def test(self):
     json_result = rating_book_request_impl(self.args)
     assert "error" not in json_result
Esempio n. 8
0
 def test_invalid_under_rating(self):
     self.args["rating"] = -1
     json_result = rating_book_request_impl(self.args)
     assert "error" in json_result
Esempio n. 9
0
 def test_invalid_book_name(self):
     self.args["book_name"] = None
     json_result = rating_book_request_impl(self.args)
     assert "error" in json_result
Esempio n. 10
0
 def test(self):
     json_result = rating_book_request_impl(self.args)
     assert "error" not in json_result