Ejemplo n.º 1
0
 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,
     )
Ejemplo n.º 2
0
    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()