def test_finding_templates_with_app_dirs_false(self):
     this_dir = os.path.dirname(__file__)
     result = list_template_files()
     expected = [
         os.path.join(this_dir, "more_templates", "another_template.html")
     ]
     self.assertEqual(set(expected), set(result))
 def test_finding_templates_with_test_app(self):
     # If 'tests' is the only installed app, we find its templates
     this_dir = os.path.dirname(__file__)
     result = list_template_files()
     expected = [
         os.path.join(this_dir, "templates", filename) for filename in [
             "test_file_B.html",
             "test_file_A.txt",
             "test_dir_C/test_file_D.zip",
         ]
     ]
     self.assertEqual(set(expected), set(result))
 def test_finding_templates_in_additional_dirs(self):
     # If the user configured additional dirs to find templates in, we spot them
     result = list_template_files()
     this_dir = os.path.dirname(__file__)
     self.assertEqual(
         set(result), {
             os.path.join(this_dir, "templates", filename)
             for filename in [
                 "test_file_B.html",
                 "test_file_A.txt",
                 "test_dir_C/test_file_D.zip",
             ]
         } | {
             os.path.join(this_dir, "more_templates",
                          "another_template.html")
         })
 def test_finding_templates_without_test_app(self):
     # If there are no installed apps, we don't find any templates
     result = list_template_files()
     expected = []
     self.assertEqual(set(expected), set(result))