예제 #1
0
    def test_in_alternative_currency__more(self):
        primary_currency = EURCurrencyFactory()
        primary_currency.primary = True
        primary_currency.save()
        alternative_currency = USDCurrencyFactory()

        order = TestOrderFactory(currency=alternative_currency,
                                 exchange_rate=Decimal("1.06649"))
        self.assertEqual(
            order.total_in_primary_currency().quantize(Decimal(".01")),
            Decimal("32.82"))
예제 #2
0
    def test_in_alternative_currency__more(self):
        primary_currency = EURCurrencyFactory()
        primary_currency.primary = True
        primary_currency.save()
        alternative_currency = USDCurrencyFactory()

        order = TestOrderFactory(
            currency=alternative_currency, exchange_rate=Decimal("1.06649")
        )
        self.assertEqual(
            order.total_in_primary_currency().quantize(Decimal(".01")), Decimal("32.82")
        )
예제 #3
0
    def test_in_alternative_currency__more(self):
        primary_currency = EURCurrencyFactory()
        primary_currency.primary = True
        primary_currency.save()
        alternative_currency = USDCurrencyFactory()

        order = TestOrderFactory(currency=alternative_currency)
        OrderRefund.objects.create(
            order=order, amount=Decimal("5.00"), exchange_rate=Decimal("1.06649")
        )
        self.assertEqual(
            order.refund_in_primary_currency().quantize(Decimal(".01")), Decimal("4.69")
        )
예제 #4
0
    def test_in_alternative_currency__more(self):
        primary_currency = EURCurrencyFactory()
        primary_currency.primary = True
        primary_currency.save()
        alternative_currency = USDCurrencyFactory()

        order = TestOrderFactory(currency=alternative_currency)
        OrderRefund.objects.create(order=order,
                                   amount=Decimal("5.00"),
                                   exchange_rate=Decimal("1.06649"))
        self.assertEqual(
            order.refund_in_primary_currency().quantize(Decimal(".01")),
            Decimal("4.69"))