Merge lp://qastaging/~mwhudson/launchpad/test_traverse-set-participation-bug-611570 into lp://qastaging/launchpad
Proposed by
Michael Hudson-Doyle
Status: | Merged |
---|---|
Approved by: | Gary Poster |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11300 |
Proposed branch: | lp://qastaging/~mwhudson/launchpad/test_traverse-set-participation-bug-611570 |
Merge into: | lp://qastaging/launchpad |
Diff against target: |
142 lines (+106/-2) 2 files modified
lib/lp/testing/publication.py (+14/-2) lib/lp/testing/tests/test_publication.py (+92/-0) |
To merge this branch: | bzr merge lp://qastaging/~mwhudson/launchpad/test_traverse-set-participation-bug-611570 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gary Poster (community) | Approve | ||
Review via email: mp+31731@code.qastaging.launchpad.net |
Commit message
Add tests for the test_traverse helper and make it set up its own interaction properly
Description of the change
Hi,
This branch started out by making test_traverse set up a new interaction for the traversal it performs, so as to make the request that is being traversed 'current'. Then I wrote some more tests and discovered that, at least in some sense, the docstring's claim that it 'uses the current user' was inaccurate, so I fixed that too.
The key test helper I use is bonkers, but I think that's zope's fault (you can read the implementation of the browser:page in zope.browserpag
Cheers,
mwh
To post a comment you must log in.
Very nice, thank you.
FWIW, yes, browser:page was disparaged and eliminated from use at my last job (ZC), because of the dynamic class creation. (The newer approach is to subclass from zope.publisher. browser. BrowserPage, define your own __call__, and simply register the resulting class as an adapter.) That's what I/we didn't like about it, anyway.