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.

test_settings.py 1.2KB

1234567891011121314151617181920212223242526272829303132333435
  1. from django.conf import settings
  2. from django.test import TestCase
  3. from django.template import loader, TemplateDoesNotExist
  4. class TestOscarInstalledAppsList(TestCase):
  5. def test_includes_oscar_itself(self):
  6. installed_apps = settings.INSTALLED_APPS
  7. self.assertTrue('oscar' in installed_apps)
  8. class TestOscarTemplateSettings(TestCase):
  9. """
  10. Oscar's OSCAR_MAIN_TEMPLATE_DIR setting
  11. """
  12. def test_allows_a_template_to_be_accessed_via_two_paths(self):
  13. paths = ['base.html', 'oscar/base.html']
  14. for path in paths:
  15. try:
  16. loader.get_template(path)
  17. except TemplateDoesNotExist:
  18. self.fail("Template %s should exist" % path)
  19. def test_allows_a_template_to_be_customized(self):
  20. path = 'base.html'
  21. template = loader.get_template(path)
  22. rendered_template = template.render({})
  23. self.assertIn('Oscar Test Shop', rendered_template)
  24. def test_default_oscar_templates_are_accessible(self):
  25. path = 'oscar/base.html'
  26. template = loader.get_template(path)
  27. rendered_template = template.render({})
  28. self.assertNotIn('Oscar Test Shop', rendered_template)