Esempio n. 1
0
 def test_get_one(self):
     book_id = self.book.book_id
     for i, xdata in enumerate(fixtures.transaction_data):
         transaction_id = self.transactions[i].transaction_id
         with assert_max_queries(2):
             o = self.query_obj.get(book_id, transaction_id)
         self.check_match(o, xdata)
Esempio n. 2
0
 def test_delete_transaction(self):
     book_id = self.book.book_id
     for i, xdata in enumerate(fixtures.transaction_data):
         transaction_id = self.transactions[i].transaction_id
         self.assert_transaction_exists(xdata)
         with assert_max_queries(3):
             assert self.query_obj.delete(book_id, transaction_id)
         self.assert_transaction_not_exists(xdata)
Esempio n. 3
0
 def test_get_book(self):
     with assert_max_queries(2):
         qres = self.query_obj.all(book_id=self.book.book_id)
     for x, o in _pair(fixtures.transaction_data, qres, 'transaction_id'):
         self.check_match(o, x)