OK, silly me. I should have paid more attention to the message. This fixes 
it:
@method_decorator(cache_control(max_age=60 * 60 * 24, immutable=True, 
public=True), name='dispatch')

On Wednesday, 22 June 2022 at 12:51:18 UTC+1 Matthew Hegarty wrote:

> Hi All
>
> I'm upgrading to 4.0.5 from 3.2.13
>
> My integration test fails:
>
> class FaviconTests(SimpleTestCase):
>     def test_get(self):
>         response = self.client.get("/favicon.ico")
>         self.assertEqual(response.status_code, HTTPStatus.OK)
>         self.assertEqual(response["Cache-Control"], "max-age=86400, 
> immutable, public")
>         self.assertEqual(response["Content-Type"], "image/png")
>         content = b"".join(response.streaming_content)
>         self.assertGreater(len(content), 0)
>
> Error is:
>
> TypeError: cache_control didn't receive an HttpRequest. If you are 
> decorating a classmethod, be sure to use @method_decorator.
>
> Can anyone advise if this is a known issue?
>
> thanks
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6f27c19c-9ea6-4aab-84b2-e271682b07e6n%40googlegroups.com.

Reply via email to