Exemplo n.º 1
0
 def test_existing(self):
     "A template can be loaded from an egg"
     settings.INSTALLED_APPS = ['egg_1']
     egg_loader = EggLoader()
     contents, template_name = egg_loader.load_template_source("y.html")
     self.assertEqual(contents, "y")
     self.assertEqual(template_name, "egg:egg_1:templates/y.html")
Exemplo n.º 2
0
 def test_existing(self):
     "A template can be loaded from an egg"
     settings.INSTALLED_APPS = ['egg_1']
     egg_loader = EggLoader()
     contents, template_name = egg_loader.load_template_source("y.html")
     self.assertEqual(contents, "y")
     self.assertEqual(template_name, "egg:egg_1:templates/y.html")
Exemplo n.º 3
0
 def test_existing(self):
     "A template can be loaded from an egg"
     with app_cache._with_app('egg_1'):
         egg_loader = EggLoader()
         contents, template_name = egg_loader.load_template_source("y.html")
         self.assertEqual(contents, "y")
         self.assertEqual(template_name, "egg:egg_1:templates/y.html")
Exemplo n.º 4
0
    def get_template_loaders(self):
        """Some loaders have nested loaders that are what we actually use."""
        if Engine is None:
            loader = Loader()
            return getattr(loader, 'loaders', [loader])

        engine = Engine.get_default()
        loaders = []
        for loader in engine.template_loaders:
            loaders += getattr(loader, 'loaders', [loader])
        return loaders
Exemplo n.º 5
0
 def test_existing(self):
     "A template can be loaded from an egg"
     egg_loader = EggLoader(Engine.get_default())
     contents, template_name = egg_loader.load_template_source("y.html")
     self.assertEqual(contents, "y")
     self.assertEqual(template_name, "egg:egg_1:templates/y.html")
Exemplo n.º 6
0
 def test_existing(self):
     "A template can be loaded from an egg"
     egg_loader = EggLoader(Engine.get_default())
     contents, template_name = egg_loader.load_template_source("y.html")
     self.assertEqual(contents, "y")
     self.assertEqual(template_name, "egg:egg_1:templates/y.html")