1 from unittest import TestCase
2 from formencode import Invalid
4 from bluechips.model import types
6 class TestCurrencyValidator(TestCase):
8 self.v = types.CurrencyValidator()
10 def test_currency_validator_good(self):
11 assert (self.v.to_python('12.34') ==
12 types.Currency('12.34'))
14 def test_currency_validator_nonzero(self):
20 def test_currency_validator_precision(self):
22 self.v.to_python('12.345')
26 def test_currency_validator_amount(self):
28 self.v.to_python('foo')