Esempio n. 1
0
 def test_get_extra_costs_monthly_cost(self):
     self.assertEqual(
         self.venture.id,
         ExtraCostPlugin.get_extra_costs_monthly_cost(
             self.start,
             self.end,
             [self.venture],
         )[0][0]['pricing_venture'])
     self.assertEqual(
         self.type,
         ExtraCostPlugin.get_extra_costs_monthly_cost(
             self.start,
             self.end,
             [self.venture],
         )[0][0]['type'])
     self.assertEqual(
         self.value,
         ExtraCostPlugin.get_extra_costs_monthly_cost(
             self.start,
             self.end,
             [self.venture],
         )[0][0]['total_cost'])
     self.assertEqual(
         self.value,
         ExtraCostPlugin.get_extra_costs_monthly_cost(
             self.start,
             self.end,
             [self.venture],
         )[1])
Esempio n. 2
0
 def test_get_extra_costs_monthly_cost(self):
     self.assertEqual(
         self.venture.id,
         ExtraCostPlugin.get_extra_costs_monthly_cost(
             self.start,
             self.end,
             [self.venture],
         )[0][0]['pricing_venture']
     )
     self.assertEqual(
         self.type,
         ExtraCostPlugin.get_extra_costs_monthly_cost(
             self.start,
             self.end,
             [self.venture],
         )[0][0]['type']
     )
     self.assertEqual(
         self.value,
         ExtraCostPlugin.get_extra_costs_monthly_cost(
             self.start,
             self.end,
             [self.venture],
         )[0][0]['total_cost']
     )
     self.assertEqual(
         self.value,
         ExtraCostPlugin.get_extra_costs_monthly_cost(
             self.start,
             self.end,
             [self.venture],
         )[1]
     )
Esempio n. 3
0
 def test_schema(self):
     self.assertEqual(
         True,
         ExtraCostPlugin.schema()['extra_cost_{}'.format(
             self.type.id)]['currency'])
     self.assertEqual(
         self.type.name,
         ExtraCostPlugin.schema()['extra_cost_{}'.format(
             self.type.id)]['name'])
     self.assertEqual(
         True,
         ExtraCostPlugin.schema()['extra_costs_total']['total_cost'])
     self.assertEqual('Extra Costs Total',
                      ExtraCostPlugin.schema()['extra_costs_total']['name'])
Esempio n. 4
0
 def test_costs(self):
     self.assertEqual(
         self.value,
         ExtraCostPlugin.costs(
             self.start,
             self.end,
             [self.venture],
         )[1]['extra_cost_{}'.format(self.type.id)])
     self.assertEqual(
         self.value * 2,
         ExtraCostPlugin.costs(
             self.start,
             self.end,
             [self.venture],
         )[1]['extra_costs_total'])
Esempio n. 5
0
 def test_get_extra_costs(self):
     self.assertEqual(
         self.venture,
         ExtraCostPlugin.get_extra_costs(
             self.start,
             self.end,
             [self.venture],
         )[0].pricing_venture)
     self.assertEqual(
         self.type,
         ExtraCostPlugin.get_extra_costs(
             self.start,
             self.end,
             [self.venture],
         )[0].type)
Esempio n. 6
0
 def test_costs(self):
     self.assertEqual(
         self.value,
         ExtraCostPlugin.costs(
             self.start,
             self.end,
             [self.venture],
         )[1]['extra_cost_{}'.format(self.type.id)]
     )
     self.assertEqual(
         self.value,
         ExtraCostPlugin.costs(
             self.start,
             self.end,
             [self.venture],
         )[1]['extra_costs_total']
     )
Esempio n. 7
0
 def test_get_extra_costs(self):
     self.assertEqual(
         self.venture,
         ExtraCostPlugin.get_extra_costs(
             self.start,
             self.end,
             [self.venture],
         )[0].pricing_venture
     )
     self.assertEqual(
         self.type,
         ExtraCostPlugin.get_extra_costs(
             self.start,
             self.end,
             [self.venture],
         )[0].type
     )
Esempio n. 8
0
 def test_total_cost(self):
     self.assertEqual(
         self.value,
         ExtraCostPlugin.total_cost(
             self.start,
             self.end,
             [self.venture]
         )
     )
Esempio n. 9
0
 def test_schema(self):
     self.assertEqual(
         True,
         ExtraCostPlugin.schema()[
             'extra_cost_{}'.format(self.type.id)
         ]['currency']
     )
     self.assertEqual(
         self.type.name,
         ExtraCostPlugin.schema()[
             'extra_cost_{}'.format(self.type.id)
         ]['name']
     )
     self.assertEqual(
         True,
         ExtraCostPlugin.schema()['extra_costs_total']['total_cost']
     )
     self.assertEqual(
         'Extra Costs Total',
         ExtraCostPlugin.schema()['extra_costs_total']['name']
     )
Esempio n. 10
0
 def test_total_cost(self):
     self.assertEqual(
         self.value * 2,
         ExtraCostPlugin.total_cost(self.start, self.end, [self.venture]))