'Tests for not being a file'

def test_template_loader_postmortem_notafile(self):

    try:
        template_path = mkdtemp()
        template_name = os.path.basename(template_path)
        tempdir = os.path.dirname(template_path)
        with override_settings(TEMPLATE_DIRS=(tempdir,)):
            response = self.client.get(reverse(u'raises_template_does_not_exist', kwargs={u'path': template_name}))
        self.assertContains(response, (u'%s    (Not    a    file)' % template_path), status_code=500, count=1)
    finally:
        shutil.rmtree(template_path)
