Opened 13 years ago

Closed 13 years ago

#17848 closed Bug (fixed)

Template context processors cache needs to be restored after it is cleared

Reported by: Ryan Kaskel Owned by: ryan
Component: contrib.auth Version: 1.4-beta-1
Severity: Normal Keywords: tests
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

I contributed the portion of the patch for #16366 where context._standard_context_processors is set to None`.

Unfortunatley, I neglected to restore the cache as it was at the end of the test.

The effect of this is that cache is now wrong for the rest of my project (and will be for others) and other tests fail.

This patch fixes this.

Attachments (4)

17848.diff (1.6 KB ) - added by Ryan Kaskel 13 years ago.
17848-1.diff (1.1 KB ) - added by Ryan Kaskel 13 years ago.
just clear the cache again after the test
17848-2.diff (9.7 KB ) - added by Claude Paroz 13 years ago.
Use the signal_changed approach
17848-3.diff (10.9 KB ) - added by Claude Paroz 13 years ago.
Update patch for current trunk

Download all attachments as: .zip

Change History (13)

by Ryan Kaskel, 13 years ago

Attachment: 17848.diff added

comment:1 by Claude Paroz, 13 years ago

I think it would be easier to just empty the cache again at the end of the tests.

comment:2 by Ryan Kaskel, 13 years ago

You're right. That's much simpler.

by Ryan Kaskel, 13 years ago

Attachment: 17848-1.diff added

just clear the cache again after the test

comment:3 by Preston Holmes, 13 years ago

Triage Stage: UnreviewedReady for checkin

Just ran tests and they pass - this looks like a sane approach

by Claude Paroz, 13 years ago

Attachment: 17848-2.diff added

Use the signal_changed approach

comment:4 by Claude Paroz, 13 years ago

Triage Stage: Ready for checkinAccepted

I'd just like some other committer to judge if the signal_setting approach might be a little cleaner. I also changed TEMPLATE_CONTEXT_PROCESSORS overriding in other tests to be consistent.

comment:5 by Aymeric Augustin, 13 years ago

I'm not comfortable with large changes this close to 1.4 final. I think we could commit the first version now, and implement the signal_setting-based technique after 1.4.

comment:6 by Claude Paroz, 13 years ago

In [17736]:

Reset template context processors cache after tests. Refs #17848.

comment:7 by Claude Paroz, 13 years ago

Severity: Release blockerNormal

Severity back to normal. Patch using setting_changed signal will be applied later.

by Claude Paroz, 13 years ago

Attachment: 17848-3.diff added

Update patch for current trunk

comment:8 by Claude Paroz, 13 years ago

Note that currenlty, the test messages.SessionTest.test_middleware_disabled_fail_silently does not pass when it is run individually, which is a symptom of the context processors cache issue (fixed in the latest patch).

comment:9 by Claude Paroz, 13 years ago

Resolution: fixed
Status: newclosed

In [17885]:

Fixed #17848 -- Added setting_changed signal for cases when TEMPLATE_CONTEXT_PROCESSORS is overriden in tests.

Note: See TracTickets for help on using tickets.
Back to Top