Code

#18924 closed Bug (fixed)

test.Client.logout doesn't send user_logged_out signal

Reported by: awsum Owned by: fhahn
Component: Testing framework Version: master
Severity: Normal Keywords:
Cc: marc.tamlyn@…, flo@… Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As docs say user_logged_out signal should be send wherever logout method called. Instead of reusing contrib.auth.logout Client doing session clean up by it's own and doesn't send user_logged_out signal.

Fix: https://github.com/django/django/pull/322

Attachments (0)

Change History (7)

comment:1 Changed 20 months ago by awsum

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 20 months ago by mjtamlyn

  • Cc marc.tamlyn@… added
  • Needs documentation set
  • Triage Stage changed from Unreviewed to Accepted

There's one unused import in the current patch which I've highlighted on github.

This should be mentioned in release notes as someone may have signals which now get fired by their tests and are unexpected. There's probably no need to mention it in the normal docs though.

comment:3 Changed 20 months ago by mjtamlyn

  • Triage Stage changed from Accepted to Ready for checkin

Subject to release notes, this is now RFC.

comment:4 Changed 15 months ago by anonymous

Can we have this anytime soon?

comment:5 Changed 15 months ago by mjtamlyn

  • Patch needs improvement set
  • Triage Stage changed from Ready for checkin to Accepted

Patch has now gone stale - it will need updating for custom user models.

comment:6 Changed 14 months ago by fhahn

  • Cc flo@… added
  • Owner changed from nobody to fhahn
  • Patch needs improvement unset
  • Status changed from new to assigned

I've updated the patch (after contacting the creator of the patch) and created a new pull request: https://github.com/django/django/pull/731

comment:7 Changed 11 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In a35ed202419a054a9125ee6205a1a7b4eb3cb46d:

Fixed #18924 -- Made test.Client.logout send user_logged_out signal.

Thanks awsum for the suggestion and Pavel Ponomarev and
Florian Hahn for the patch.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.