'Tests for not existing file'

def test_template_loader_postmortem(self):

    template_name = u'notfound.html'
    with NamedTemporaryFile(prefix=template_name) as tempfile:
        tempdir = os.path.dirname(tempfile.name)
        template_path = os.path.join(tempdir, template_name)
        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    (File    does    not    exist)' % template_path), status_code=500, count=1)
