def test_delete_all_books(self): bk1 = Book(title='Interesting Title', author='Author') bk2 = Book(title='Whatever', author='W. Whatever') bk1.save() bk2.save() bookstore.delete_all_books() self.assertEqual(0, bookstore.book_count())
def test_delete_all_books(self): self.clear_bookstore() bk1 = Book(title='Not in store', author='Not in store') bk2 = Book(title='Whatever', author='Whatever') store.add_book(bk1) store.add_book(bk2) store.delete_all_books() self.assertEqual(0, store.book_count())
def setUp(self): # self.store = BookStore() store.delete_all_books()
def clear_bookstore(self): bookstore.delete_all_books()
def test_delete_all_books_empty(self): bookstore.delete_all_books() self.assertEqual(0, bookstore.book_count())
def test_add_book_empty_store(self): store.delete_all_books() bk = Book(author='aa', title='aaa') store.add_book(bk) self.assertTrue(store.get_book_by_id(bk.id)) self.assertEqual(1, store.book_count())