示例#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])
示例#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]
     )
示例#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'])
示例#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'])
示例#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)
示例#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']
     )
示例#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
     )
示例#8
0
 def test_total_cost(self):
     self.assertEqual(
         self.value,
         ExtraCostPlugin.total_cost(
             self.start,
             self.end,
             [self.venture]
         )
     )
示例#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']
     )
示例#10
0
 def test_total_cost(self):
     self.assertEqual(
         self.value * 2,
         ExtraCostPlugin.total_cost(self.start, self.end, [self.venture]))