'A GET request that is cached closes the file after the request.'

def test_cachedRequestClosesFile(self):

    (fakeFile, file) = self._makeFilePathWithStringIO()
    request = DummyRequest([''])
    request.method = 'GET'
    request.setLastModified = (lambda _: http.CACHED)
    self.successResultOf(_render(file, request))
    self.assertEqual(''.join(request.written), '')
    self.assertTrue(fakeFile.closed)
