'Same as test_extends_include_missing_baseloader, only tests
behavior of the cached loader instead of BaseLoader.'

def test_extends_include_missing_cachedloader(self):

    (old_td, settings.TEMPLATE_DEBUG) = (settings.TEMPLATE_DEBUG, True)
    old_loaders = loader.template_source_loaders
    try:
        cache_loader = cached.Loader((u'',))
        cache_loader._cached_loaders = (app_directories.Loader(),)
        loader.template_source_loaders = (cache_loader,)
        load_name = u'test_extends_error.html'
        tmpl = loader.get_template(load_name)
        r = None
        try:
            r = tmpl.render(template.Context({}))
        except template.TemplateDoesNotExist as e:
            self.assertEqual(e.args[0], u'missing.html')
        self.assertEqual(r, None, (u'Template    rendering    unexpectedly    succeeded,    produced:    ->%r<-' % r))
        tmpl = loader.get_template(load_name)
        try:
            tmpl.render(template.Context({}))
        except template.TemplateDoesNotExist as e:
            self.assertEqual(e.args[0], u'missing.html')
        self.assertEqual(r, None, (u'Template    rendering    unexpectedly    succeeded,    produced:    ->%r<-' % r))
    finally:
        loader.template_source_loaders = old_loaders
        settings.TEMPLATE_DEBUG = old_td
