From ab49663ce1205d1f9fb902640e75eadb1298d395 Mon Sep 17 00:00:00 2001 From: Antoine LAURENT Date: Tue, 12 Jul 2022 17:37:39 +0200 Subject: [PATCH] peamu: Test logout with AnonymousUsers --- itou/allauth_adapters/peamu/tests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/itou/allauth_adapters/peamu/tests.py b/itou/allauth_adapters/peamu/tests.py index 5ec04f55b3..5009202fcd 100644 --- a/itou/allauth_adapters/peamu/tests.py +++ b/itou/allauth_adapters/peamu/tests.py @@ -185,3 +185,8 @@ def test_job_seeker_temporary_nir_with_pe_conect(self, mock_login_signal): self.login(self.get_mocked_response()) job_seeker = User.objects.get(email="john.doe@example.com") self.assertIsNone(job_seeker.nir) + + def test_anonymous_user_logout(self): + # An AnonymousUser does not have the peamu_id_token attribute + # but logout should not raise an error + self.client.post(reverse("account_logout"))