Beispiel #1
0
 def setUp(self):
     self.MoneyClass = XMoney
     self.x = XMoney('10', 'XXX')
     self.a = XMoney('10', 'AAA')
     self.b = XMoney('10', 'BBB')
     self.ax = XMoney('20', 'AAA')
     self.bx = XMoney('80', 'BBB')
Beispiel #2
0
 def test_sub(self):
     self.assertEqual(self.a - self.b, XMoney('7.5', 'AAA'))
     self.assertEqual(self.b - self.a, XMoney('-30', 'BBB'))
Beispiel #3
0
 def test_add(self):
     self.assertEqual(self.a + self.b, XMoney('12.5', 'AAA'))
     self.assertEqual(self.b + self.a, XMoney('50', 'BBB'))
Beispiel #4
0
 def setUp(self):
     self.money = XMoney('2.99', 'XXX')
Beispiel #5
0
 def test_sub_money_different_currency(self):
     self.assertEqual(self.a - self.b, XMoney('7.5', 'AAA'))
     self.assertEqual(self.b - self.a, XMoney('-30', 'BBB'))
Beispiel #6
0
 def test_add_money_different_currency(self):
     self.assertEqual(self.a + self.b, XMoney('12.5', 'AAA'))
     self.assertEqual(self.b + self.a, XMoney('50', 'BBB'))
Beispiel #7
0
 def setUp(self):
     self.money = XMoney('-1234.567', 'USD')
Beispiel #8
0
 def setUp(self):
     self.money = XMoney('1234.567', 'XXX')