Exemplo n.º 1
0
    def test_zero_if_order_incomplete(self):
        """
        Test that if an order doesn't have all the VAT fields, the pricing is zero.
        """
        order = Order(vat_status=None)
        pricing = calculate_order_pricing(order)

        assert pricing == ZERO_PRICING
Exemplo n.º 2
0
    def test_zero_with_no_estimated_time(self):
        """
        Test that if an order doesn't have any assignees, the pricing is zero.
        """
        order = OrderFactory(assignees=[])
        assert not order.assignees.count()

        order = Order(vat_status=None)
        pricing = calculate_order_pricing(order)

        assert pricing == ZERO_PRICING
Exemplo n.º 3
0
    def test_without_applied_vat(self, fields):
        """Test when the VAT status doesn't require the VAT to be applied."""
        hourly_rate = HourlyRateFactory(rate_value=110,
                                        vat_value=Decimal(19.5))
        order = OrderFactory(
            **fields,
            discount_value=100,
            hourly_rate=hourly_rate,
            assignees=[],
        )
        OrderAssigneeFactory(order=order, estimated_time=140)

        pricing = calculate_order_pricing(order)

        assert pricing.net_cost == 257
        assert pricing.subtotal_cost == 157
        assert pricing.vat_cost == 0
        assert pricing.total_cost == 157