Exemple #1
0
 def test_init_normal(self):
     sale = classes.Sale(customer=mock.Mock(classes.Customer),
                         description="Potato Chips",
                         quantity=3,
                         unitprice=decimal.Decimal(40),
                         notes="Random Notes",
                         income_account=mock.Mock(classes.Account),
                         date=datetime.date.today(),
                         currency=mock.Mock(classes.Currency))
Exemple #2
0
 def test_invalid_currency(self, invalid_currency):
     with pytest.raises(AssertionError):
         classes.Sale(customer=mock.Mock(classes.Customer),
                      description=mock.Mock(str),
                      quantity=mock.Mock(int),
                      unitprice=mock.Mock(decimal.Decimal),
                      notes=mock.Mock(str),
                      income_account=mock.Mock(classes.Account),
                      date=mock.Mock(datetime.date),
                      currency=invalid_currency)