lp.testing.publication.test_traverse doesn't set the current participation
Bug #611570 reported by
Michael Hudson-Doyle
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Low
|
Michael Hudson-Doyle |
Bug Description
test_traverse's docstring claims that it "uses the currently logged in user" which is all well and good, but this means that it does not set up a new interaction, which in turn means that you will end up with a different request object being current as per get_current_
I have a two line fix, but I'm not completely sure of it...
Related branches
lp://qastaging/~mwhudson/launchpad/test_traverse-set-participation-bug-611570
- Gary Poster (community): Approve
-
Diff: 142 lines (+106/-2)2 files modifiedlib/lp/testing/publication.py (+14/-2)
lib/lp/testing/tests/test_publication.py (+92/-0)
Changed in launchpad-foundations: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in launchpad-foundations: | |
status: | Triaged → Fix Committed |
milestone: | none → 10.08 |
assignee: | nobody → Michael Hudson (mwhudson) |
tags: |
added: qa-untestable removed: qa-needstesting |
tags: |
added: qa-ok removed: qa-untestable |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
From one perspective, a reasonable fix would be to do the following within test_traverse.
(before traversing) management import endInteraction, newInteraction, restoreInteraction request)
from zope.security.
endInteraction()
newInteraction(
(after traversing) ion()
restoreInteract
We also could rip out the current participation (request) from the current interaction and replace it temporarily. This is a bit riskier; typically you want to make sure that the interaction (security policy instance) has the ability to clear any decision caches.
What did you have in mind?