You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

settings_tests.py 1.0KB

123456789101112131415161718192021222324252627282930313233
  1. from django.test import TestCase
  2. from django.template import loader, base
  3. import oscar
  4. class TestOscarCoreAppsList(TestCase):
  5. def test_includes_oscar_itself(self):
  6. core_apps = oscar.OSCAR_CORE_APPS
  7. self.assertTrue('oscar' in core_apps)
  8. def test_can_be_retrieved_through_fn(self):
  9. core_apps = oscar.get_core_apps()
  10. self.assertTrue('oscar' in core_apps)
  11. def test_can_be_retrieved_with_overrides(self):
  12. apps = oscar.get_core_apps(overrides=['apps.shipping'])
  13. self.assertTrue('apps.shipping' in apps)
  14. self.assertTrue('oscar.apps.shipping' not in apps)
  15. class TestOscarTemplateSettings(TestCase):
  16. """
  17. Oscar's OSCAR_MAIN_TEMPLATE_DIR setting
  18. """
  19. def test_allows_a_template_to_be_accessed_via_two_paths(self):
  20. paths = ['base.html', 'oscar/base.html']
  21. for path in paths:
  22. try:
  23. loader.get_template(path)
  24. except base.TemplateDoesNotExist:
  25. self.fail("Template %s should exist" % path)