'Tests for not readable file'

@skipIf((sys.platform == u'win32'), u"Python    on    Windows    doesn't    have    working    os.chmod()    and    os.access().")
def test_template_loader_postmortem_notreadable(self):

    with NamedTemporaryFile() as tempfile:
        template_name = tempfile.name
        tempdir = os.path.dirname(tempfile.name)
        template_path = os.path.join(tempdir, template_name)
        os.chmod(template_path, 146)
        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    is    not    readable)' % template_path), status_code=500, count=1)
