def test_cache_control(self):
        """Ensure that resources can specify custom cache control directives"""
        connection = self.get_connection()
        connection.request('GET', '/api/v1/cached_users/', headers={'Accept': 'application/json'})
        response = connection.getresponse()
        connection.close()
        self.assertEqual(response.status, 200)

        headers = dict(response.getheaders())
        self.assertEqual(headers['cache-control'], "max-age=3600",
                         "Resource-defined Cache-Control headers should be unmodified")
        self.assertTrue('"johndoe"' in response.read())
dataset/ETHPy150Open mozilla/inventory/vendor-local/src/django-tastypie/tests/basic/tests/http.py/HTTPTestCase.test_cache_control/original