def test_setting_explicit_timestamp_field(self): transaction = TransactionFactory() old_posted_timestamp = transaction.posted_timestamp transaction.posted_timestamp = datetime.now() transaction.save() self.assertNotEqual( old_posted_timestamp, transaction.posted_timestamp, )
def test_editing_transactions(self): transaction = TransactionFactory() transaction.notes = 'foo' transaction.save() entry = transaction.entries.last() entry.amount += Decimal('1') entry.save() with self.assertRaises(TransactionBalanceException): transaction.save()