Example #1
0
 def test_cents_to_usd_two_decimal_places(self):
     """Always return a Decimal with 2 decimal places."""
     assert str(USDollar.cents_to_usd(100)) == '1.00'
     assert str(USDollar.cents_to_usd(350)) == '3.50'
     assert str(USDollar.cents_to_usd(1000)) == '10.00'
Example #2
0
 def test_cents_to_usd(self):
     """Return a Decimal USD value given an integer."""
     assert USDollar.cents_to_usd(100) == Decimal('1.00')
     assert USDollar.cents_to_usd(299) == Decimal('2.99')
     assert USDollar.cents_to_usd(350) == Decimal('3.50')