Exemple #1
0
 def test_format(self):
     f = MoneyDbField(max_digits=5, decimal_places=3)
     self.assertEqual(f._format(f.to_python(2)), '2.000')
     self.assertEqual(f._format(f.to_python('2.34567')), '2.346')
     self.assertEqual(f._format(None), None)
Exemple #2
0
 def test_format(self):
     f = MoneyDbField(max_digits=5, decimal_places=3)
     self.assertEqual(f._format(f.to_python(2)), '2.000')
     self.assertEqual(f._format(f.to_python('2.34567')), '2.346')
     self.assertEqual(f._format(None), None)
Exemple #3
0
def test_format():
    f = MoneyDbField(max_digits=5, decimal_places=3)
    assert f._format(f.to_python(2)) == '2.000'
    assert f._format(f.to_python('2.34567')) == '2.346'
    assert f._format(None) is None