util_tests.py 603 B

123456789101112131415161718192021222324252627282930
  1. from django.test import TestCase
  2. from .. import constants
  3. from .. import utils
  4. class StateFixture(TestCase):
  5. state = ""
  6. expected = False
  7. def setUp(self):
  8. self.result = utils._is_us_state(self.state)
  9. def test(self):
  10. self.assertEquals(self.result, self.expected)
  11. class SubscriptionTypeFixture(TestCase):
  12. zip = ""
  13. state = ""
  14. county = "NOTUS"
  15. expected = constants.FOREIGN
  16. def setUp(self):
  17. self.result = utils.subscription_type(self.zip, self.state, self.county)
  18. def test(self):
  19. self.assertEquals(self.result, self.expected)