From 8a09037cb3b5873b285386de870d9d26571e9b3c Mon Sep 17 00:00:00 2001 From: NikosVlagoidis Date: Thu, 29 Jun 2017 16:14:38 +0300 Subject: [PATCH] Add Tests for Logout Anonymous User Fixes https://github.com/Tivix/django-rest-auth/issues/332 --- rest_auth/tests/test_api.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rest_auth/tests/test_api.py b/rest_auth/tests/test_api.py index 0356d19..a8e477a 100644 --- a/rest_auth/tests/test_api.py +++ b/rest_auth/tests/test_api.py @@ -493,3 +493,11 @@ class APITestCase1(TestCase, BaseAPITestCase): self.post(self.login_url, data=payload, status_code=status.HTTP_200_OK) self.get(self.logout_url, status_code=status.HTTP_405_METHOD_NOT_ALLOWED) + + @override_settings(ACCOUNT_LOGOUT_ON_GET=True) + def test_logout_anonymous_user(self): + payload = { + + } + self.post(self.logout_url, data=payload, staus_code=status.HTTP_400_BAD_REQUEST) + self.get(self.logout_url, status_code=status.HTTP_400_BAD_REQUEST)