added new test for decimal positions
This commit is contained in:
parent
135d204dad
commit
02e608fa02
1 changed files with 14 additions and 0 deletions
|
|
@ -27,6 +27,20 @@ def test_exchange_rate_creation_works():
|
|||
assert a_rate.rate_date == datetime.date.today()
|
||||
|
||||
|
||||
def test_exchange_rate_can_hold_8_decimal_positions():
|
||||
a_rate = ExchangeRate(
|
||||
from_currency=Currency.USD,
|
||||
to_currency=Currency.EUR,
|
||||
rate=Decimal("1.12345678"),
|
||||
rate_date=datetime.date.today(),
|
||||
)
|
||||
|
||||
assert a_rate.from_currency.value == "USD"
|
||||
assert a_rate.to_currency.value == "EUR"
|
||||
assert a_rate.rate.amount == Decimal("1.12345678")
|
||||
assert a_rate.rate_date == datetime.date.today()
|
||||
|
||||
|
||||
def test_descriptor_builds_properly():
|
||||
|
||||
a_rate = ExchangeRate(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue