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')
def test_sub(self): self.assertEqual(self.a - self.b, XMoney('7.5', 'AAA')) self.assertEqual(self.b - self.a, XMoney('-30', 'BBB'))
def test_add(self): self.assertEqual(self.a + self.b, XMoney('12.5', 'AAA')) self.assertEqual(self.b + self.a, XMoney('50', 'BBB'))
def setUp(self): self.money = XMoney('2.99', 'XXX')
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'))
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'))
def setUp(self): self.money = XMoney('-1234.567', 'USD')
def setUp(self): self.money = XMoney('1234.567', 'XXX')