def test_transactions_readonly(self): book = gcdomain_test_util.book() try: book.transactions = () raise AssertionError('Book.transactions should be readonly') except AttributeError: pass try: book.transactions[0] = None raise AssertionError('Elements of Book.transactions should not be settable') except TypeError: pass self.assertRaises(AttributeError, lambda x: x.append, book.transactions) self.assertRaises(AttributeError, lambda x: x.extend, book.transactions)
def test_repr(self): book = gcdomain_test_util.book() self.assertEqual(book, eval(repr(book)))