def test_tween_cache_header_adds_headers(pyramid_request, content_type, expected_cc_header): tween = tweens.cache_header_tween_factory(lambda req: req.response, pyramid_request.registry) if content_type is not None: pyramid_request.response.headers['Content-Type'] = content_type response = tween(pyramid_request) assert response.headers.get('Cache-Control') == expected_cc_header
def test_it_adds_caching_headers_to_the_response(self, pyramid_request, content_type, expected_cc_header): tween = tweens.cache_header_tween_factory(lambda req: req.response, pyramid_request.registry) if content_type is not None: pyramid_request.response.headers["Content-Type"] = content_type response = tween(pyramid_request) assert response.headers.get("Cache-Control") == expected_cc_header
def test_it_adds_caching_headers_to_the_response( self, pyramid_request, content_type, expected_cc_header ): tween = tweens.cache_header_tween_factory( lambda req: req.response, pyramid_request.registry ) if content_type is not None: pyramid_request.response.headers["Content-Type"] = content_type response = tween(pyramid_request) assert response.headers.get("Cache-Control") == expected_cc_header