Merge lp:~gmb/launchpad/bug-197775 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Graham Binns on 2010-11-19 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 11969 |
| Proposed branch: | lp:~gmb/launchpad/bug-197775 |
| Merge into: | lp:launchpad |
| Diff against target: |
138 lines (+37/-5) 4 files modified
lib/canonical/launchpad/ftests/_launchpadformharness.py (+4/-2) lib/lp/bugs/stories/structural-subscriptions/xx-bug-subscriptions.txt (+12/-0) lib/lp/registry/browser/structuralsubscription.py (+4/-1) lib/lp/registry/browser/tests/test_structuralsubscription.py (+17/-2) |
| To merge this branch: | bzr merge lp:~gmb/launchpad/bug-197775 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Curtis Hovey (community) | code | 2010-11-18 | Approve on 2010-11-19 |
| j.c.sackett (community) | code* | 2010-11-18 | Approve on 2010-11-18 |
|
Review via email:
|
|||
Commit Message
[r=jcsackett,
Description of the Change
This branch fixes bug 197775 by changing the next_url for StructuralSubsc
| j.c.sackett (jcsackett) wrote : | # |
| Graham Binns (gmb) wrote : | # |
I've made the changes as requested.
| Curtis Hovey (sinzui) wrote : | # |
Does this test really require the librarian (LaunchpadFunct
Why isn't this tested with lp.testing.
view = create_
self.
We can remove the loadTestsFromName() stuff. The testrunner will find the test without
it.
| Graham Binns (gmb) wrote : | # |
> Does this test really require the librarian (LaunchpadFunct
> looks like it requires DatabaseFunctio
>
It doesn't. Fixed.
> Why isn't this tested with lp.testing.
>
> view = create_
> self.assertEqua
>
Out of habit. I've been using the harness elsewhere. Fixed.
> We can remove the loadTestsFromName() stuff. The testrunner will find the test
> without
> it.
Done.

Graham--
I like anything that gets rid of manual url hacking/building in the code. This will be nice.
I have a few comments below.
> === modified file 'lib/canonical/ launchpad/ ftests/ _launchpadformh arness. py' launchpad/ ftests/ _launchpadformh arness. py 2010-08-20 20:31:18 +0000 launchpad/ ftests/ _launchpadformh arness. py 2010-11-18 14:02:07 +0000 rness: class=Launchpad TestRequest) : class=Launchpad TestRequest, request_ environ= None): environ = request_environ form_values) self.request_ environ) setPrincipal( get_current_ principal( )) et(self) : response. getHeader( 'location' ) environ = request_environ
> --- lib/canonical/
> +++ lib/canonical/
> @@ -19,15 +19,17 @@
> class LaunchpadFormHa
>
> def __init__(self, context, view_class, form_values=None,
> - request_
> + request_
> self.context = context
> self.view_class = view_class
> self.request_class = request_class
> + self.request_
> self._render(
>
> def _render(self, form_values=None, method='GET'):
> self.request = self.request_class(
> - method=method, form=form_values, PATH_INFO='/')
> + method=method, form=form_values, PATH_INFO='/',
> + environ=
> if queryInteraction() is not None:
> self.request.
> # Setup a new interaction using self.request, create the view,
> @@ -58,3 +60,4 @@
>
> def redirectionTarg
> return self.request.
> + self.request_
Doesn't this require passing in request_environ as an argument? Or is it in scope in a way I have missed?
> === modified file 'lib/lp/ registry/ browser/ structuralsubsc ription. py' registry/ browser/ structuralsubsc ription. py 2010-11-10 11:13:05 +0000 registry/ browser/ structuralsubsc ription. py 2010-11-18 14:02:07 +0000 rSubscription( data) mSubscriptions( data) verChanges( data) url(self. context) + '/+subscribe' url(self. context) cription( self, data): registry/ browser/ tests/test_ structuralsubsc ription. py' registry/ browser/ tests/test_ structuralsubsc ription. py 2010-11-10 11:33:45 +0000 registry/ browser/ tests/test_ structuralsubsc ription. py 2010-11-18 14:02:07 +0000 makeMilestone( )
> --- lib/lp/
> +++ lib/lp/
> @@ -205,7 +205,7 @@
> self._handleUse
> self._handleTea
> self._handleDri
> - self.next_url = canonical_
> + self.next_url = canonical_
>
> def _handleUserSubs
> """Process the subscription for the user."""
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -282,5 +282,35 @@
> self.target = self.factory.
There are a couple of lint errors in the test file:
> +class TestStructuralS ubscriptionView (TestCaseWithFa ctory): riptionView. """ onalLayer url_set_ to_context( self): riptionView form is submitted, the makeProduct( ) makePerson( ) logged_ in(person) : rness(
> + """General tests for the StructuralSubsc
> +
> + layer = LaunchpadFuncti
> +
> + def test_next_
> + # When the StructuralSubsc
> + # view's next_url is set to the canonical_url of the current
> + # target.
> + target = self.factory.
> + person = self.factory.
> + with person_
> + harness = LaunchpadFormHa
> + target, ...