#36540: `alogout` is not cleaning user cache correctly
------------------------------+--------------------------------------
     Reporter:  Xdynix        |                    Owner:  (none)
         Type:  Bug           |                   Status:  closed
    Component:  contrib.auth  |                  Version:  5.2
     Severity:  Normal        |               Resolution:  worksforme
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  1             |                    UI/UX:  0
------------------------------+--------------------------------------
Comment (by Xdynix):

 The problematic code is within ''django/contrib/auth/middleware.py''.

 Add the following test case to
 ''auth_tests.test_middleware.TestAuthenticationMiddleware'' and you can
 reproduce it:


 {{{
     async def test_auser_logout(self):
         from django.contrib.auth import alogout
         from django.contrib.auth.models import AnonymousUser
         self.middleware(self.request)
         auser = await self.request.auser()
         self.assertEqual(auser, self.user)
         await alogout(self.request)
         auser_second = await self.request.auser()
         self.assertIsInstance(auser_second, AnonymousUser)
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36540#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/010701987b1d2018-e36980c9-1a6e-4381-8a75-d87a4d1cbb8e-000000%40eu-central-1.amazonses.com.

Reply via email to