Merge lp:~henninge/launchpad/devel-766955-fix-forwardCheckAuthenticated into lp:launchpad
|Merged at revision:||12943|
|Diff against target:||237 lines (+141/-30) 3 files modified|
|To merge this branch:||bzr merge lp:~henninge/launchpad/devel-766955-fix-forwardCheckAuthenticated|
|Related bugs and blueprints:||
Prevent foot shooting with forwardCheckAut
Description of the Change
= Summary =
To fix the bug is really just a two-line fix. Quite straight forward.
The new method forwardCheckAut
defined behavior. This branch also adds that but it also adds some
== Proposed fix ==
- Introduce checkPermission
with FakeMethod during testing.
- Call checkPermisionI
- Replace getAdapter with queryAdapter and return False when the
adapter is not found.
- Add an assertion to avoid loops.
- Update the whole test to use FakeMethod and ZopelessDataseL
- Add tests for forwardCheckAut
because it involves registering an adapter.
- Introduce assertVectorEqual to test multiple values at the same time.
This formalizes a pattern that I like to use by making sure all values
are asserted. It could probably be converted to use matchers and even
be added to testtools but this implementation was the quickest for me.
(Go and read what zip() does ... ;-)
== Pre-implementation notes ==
I had talked about the fix with William after he had actually been
bitten by the bug.
== Implementation details ==
I thought I could use directlyProvide
seems not, so I had to introduce the dummy implementation of the
== Tests ==
bin/test -vvcm lp.app.
== Demo and Q/A ==
No QA possible.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files: