From f05596a088f4dac9471207f3f731ea1250aa7a1c Mon Sep 17 00:00:00 2001 From: Emmanuel Cazenave Date: Wed, 11 Jan 2023 17:09:05 +0100 Subject: [PATCH] django32: check message content directly in the page (#67760) Which is the point of interest anyway. https://code.djangoproject.com/ticket/32191 for details on why it is not possible anymore to check the plain text in the response header. --- tests/test_theme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_theme.py b/tests/test_theme.py index 23f9b5a..31de80f 100644 --- a/tests/test_theme.py +++ b/tests/test_theme.py @@ -19,8 +19,8 @@ def test_theme_view(mocked_random, app, admin_user, fake_themes): assert Variable.objects.filter(name='theme')[0].value == 'alfortville' assert Variable.objects.filter(name='foo')[0].value == 'bar' assert resp.location == '/theme/' - assert "The theme has been changed" in dict(resp.headers)['Set-Cookie'] resp = resp.follow() + assert "The theme has been changed" in str(resp.html) assert resp.form['theme'].value == 'alfortville' resp.form['theme'].value = 'publik'