Changeset View
Changeset View
Standalone View
Standalone View
looper/tests/test_templatetags.py
| from ..templatetags.looper import pricing | from ..templatetags.looper import pricing | ||||
| from .. import models | from .. import models | ||||
| from . import AbstractBaseTestCase | from .base import AbstractBaseTestCase | ||||
| class PricingTest(AbstractBaseTestCase): | class PricingTest(AbstractBaseTestCase): | ||||
| def test_plan_variation(self): | def test_plan_variation(self): | ||||
| pv = models.PlanVariation( | pv = models.PlanVariation( | ||||
| plan_id=1, | plan_id=1, currency='GBP', price=401, interval_length=3, interval_unit='day', | ||||
| currency='GBP', | |||||
| price=401, | |||||
| interval_length=3, | |||||
| interval_unit='day', | |||||
| ) | ) | ||||
| self.assertEqual('£\u00A04.01 / 3\u00A0days', pricing(pv)) | self.assertEqual('£\u00A04.01 / 3\u00A0days', pricing(pv)) | ||||
| pv.interval_length = 1 | pv.interval_length = 1 | ||||
| self.assertEqual('£\u00A04.01 / day', pricing(pv)) | self.assertEqual('£\u00A04.01 / day', pricing(pv)) | ||||