def test_get_template_directories_with_empty_template_dirs(self): """Should return an empty set if TEMPLATE_DIRS is empty, but TEMPLATES is not defined""" if hasattr(settings, 'TEMPLATES'): del settings.TEMPLATES self.TEMPLATE_DIRS = () settings.TEMPLATE_DIRS = () self.assertEqual(util.get_template_directories(), set())
def test_get_template_directories_with_templates(self): """Should return a set of DIRS from TEMPLATES if those are defined.""" self.TEMPLATE_DIRS = () if hasattr(settings, 'TEMPLATE_DIRS'): del settings.TEMPLATE_DIRS settings.TEMPLATES = [{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ["other_templates"], }] self.assertEqual(util.get_template_directories(), {'other_templates'})
def test_get_template_directories_with_empty_template_dirs(self): """Should return an empty set if TEMPLATES is empty, but TEMPLATES is not defined""" self.assertEqual(util.get_template_directories(), set())
def test_get_template_directories_with_template_dirs(self): """Should return the value of TEMPLATES if it exists and is not empty""" self.assertEqual(util.get_template_directories(), {'templates'})
def test_get_template_directories_with_templates(self): """Should return a set of DIRS from TEMPLATES if those are defined.""" self.assertEqual(util.get_template_directories(), {'other_templates'})