Code review comment for lp://staging/~thumper/launchpad/person-branch-page-private-team

Revision history for this message
Tim Penhey (thumper) wrote :

On Fri, 28 May 2010 15:00:47 you wrote:
> Review: Approve code release-critical
> Thanks for teaching me the art of setup with a logged in user. YOu have my
> RC to land this after you fix some trivial issues.

Thanks.

> > === modified file 'lib/lp/code/browser/tests/test_branchlisting.py'
> > --- lib/lp/code/browser/tests/test_branchlisting.py 2010-04-08 02:09:16
> > +0000 +++ lib/lp/code/browser/tests/test_branchlisting.py 2010-05-28
> > 01:50:44 +0000
>
> ...
>
> > @@ -355,6 +359,47 @@
> >
> > self.assertEqual('launchpad.dev', URI(link.url).host)
> >
> > +class TestPersonBranchesPage(BrowserTestCase):
> > + """Tests for the person branches page.
> > +
> > + This is the default page shown for a person on the code subdomain.
> > + """
> > +
> > + layer = DatabaseFunctionalLayer # may need to change this
>
> You do not need to change this, you can drop the comment.

Done.

> > + def _make_branch_for_private_team(self):
> > + private_team = self.factory.makeTeam(
> > + name='shh', displayname='Shh',
> > + visibility=PersonVisibility.PRIVATE)
> > + member = self.factory.makePerson(
> > + <email address hidden>', password='test')
> > + with person_logged_in(private_team.teamowner):
> > + private_team.addMember(member, private_team.teamowner)
>
> That is beautiful.

Yes it is. You can thank abentley for writing these context managers. There
is also a function decorator to run an entire test as a specific user.

> > + branch = self.factory.makeProductBranch(owner=private_team)
> > + return private_team, member, branch
> > +
> > + def test_private_team_membership_for_team_member(self):
> > + # If the logged in user can see the private teams, they are
> > shown in + # the releated 'Branches owned by' section at the
> > bottom of the page.
>
> grammar: s/releated/related/

Fixed.

« Back to merge proposal