def testValidate(self): form = MoneyForm({"money": "10", "money_currency": "SEK"}) self.assertTrue(form.is_valid()) result = form.cleaned_data['money'] self.assertTrue(isinstance(result, Money)) self.assertEquals(result.amount, Decimal("10")) self.assertEquals(result.currency, moneyed.SEK)
def testValidate(self): form = MoneyForm({"money":"10", "money_currency":"SEK"}) self.assertTrue(form.is_valid()) result = form.cleaned_data['money'] self.assertTrue(isinstance(result, Money)) self.assertEquals(result.amount, Decimal("10")) self.assertEquals(result.currency, moneyed.SEK)
def testNonExistantCurrency(self): form = MoneyForm({"money": "10", "money_currency": "_XX!123_"}) self.assertFalse(form.is_valid())
def testNonExistantCurrency(self): form = MoneyForm({"money":"10", "money_currency":"_XX!123_"}) self.assertFalse(form.is_valid())