Beispiel #1
0
    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)
Beispiel #2
0
 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())
Beispiel #4
0
 def testNonExistantCurrency(self):
 
     form = MoneyForm({"money":"10", "money_currency":"_XX!123_"})
     
     self.assertFalse(form.is_valid())