Ejemplo n.º 1
0
 def test_humanize_price_free(self):
     FREE = 'Free'
     self.assertEqual(humanize_price(0, None, 'CAD'), FREE)
     self.assertEqual(humanize_price(0.00, None, 'CAD'), FREE)
     self.assertEqual(humanize_price('0', None, 'CAD'), FREE)
     self.assertEqual(humanize_price('0.00', None, 'CAD'), FREE)
     self.assertEqual(humanize_price('0.00', 5.00, 'CAD'), 'Free-5CAD')
Ejemplo n.º 2
0
 def test_humanize_price_free(self):
     FREE = 'Free'
     self.assertEqual(humanize_price(0, None, 'CAD'), FREE)
     self.assertEqual(humanize_price(0.00, None, 'CAD'), FREE)
     self.assertEqual(humanize_price('0', None, 'CAD'), FREE)
     self.assertEqual(humanize_price('0.00', None, 'CAD'), FREE)
     self.assertEqual(humanize_price('0.00', 5.00, 'CAD'), 'Free-5CAD')
Ejemplo n.º 3
0
 def test_humanize_price_single(self):
     self.assertEqual(humanize_price(1, None, 'CAD'), '1CAD')
     self.assertEqual(humanize_price('1.50', None, 'CAD'), '1.50CAD')
Ejemplo n.º 4
0
 def test_humanize_price_range(self):
     self.assertEqual(humanize_price(1, 2, 'CAD'), '1-2CAD')
     self.assertEqual(humanize_price(2.5, 3.0, 'CAD'), '2.50-3.00CAD')
     self.assertEqual(humanize_price(2.5000, 3.1000, 'CAD'), '2.50-3.10CAD')
     # As strings
     self.assertEqual(humanize_price('2.5', '3.1', 'CAD'), '2.50-3.10CAD')
Ejemplo n.º 5
0
 def test_humanize_price_none(self):
     out = humanize_price(None, None, 'CAD')
     self.assertEqual(out, '')
Ejemplo n.º 6
0
 def test_humanize_price_single(self):
     self.assertEqual(humanize_price(1, None, 'CAD'), '1CAD')
     self.assertEqual(humanize_price('1.50', None, 'CAD'), '1.50CAD')
Ejemplo n.º 7
0
 def test_humanize_price_range(self):
     self.assertEqual(humanize_price(1, 2, 'CAD'), '1-2CAD')
     self.assertEqual(humanize_price(2.5, 3.0, 'CAD'), '2.50-3.00CAD')
     self.assertEqual(humanize_price(2.5000, 3.1000, 'CAD'), '2.50-3.10CAD')
     # As strings
     self.assertEqual(humanize_price('2.5', '3.1', 'CAD'), '2.50-3.10CAD')
Ejemplo n.º 8
0
 def test_humanize_price_none(self):
     out = humanize_price(None, None, 'CAD')
     self.assertEqual(out, '')