Hi JC,
This branch looks good. I just have one comment below.
-Edwin
>=== modified file 'lib/lp/code/browser/tests/test_branchlisting.py' >--- lib/lp/code/browser/tests/test_branchlisting.py 2010-08-24 02:21:50 +0000 >+++ lib/lp/code/browser/tests/test_branchlisting.py 2010-10-14 14:37:22 +0000 >@@ -421,5 +421,33 @@ > self.assertIs(None, branches) > > >+class TestProjectBranchListing(TestCaseWithFactory): >+ >+ layer = DatabaseFunctionalLayer >+ >+ def setUp(self): >+ super(TestProjectBranchListing, self).setUp() >+ self.project = self.factory.makeProject() >+ self.product = self.factory.makeProduct(project=self.project) >+ >+ def test_no_branches_gets_message_not_listing(self): >+ # If there are no product branches on the project's products, then >+ # the view shows the no code hosting message instead of a listing. >+ browser = self.getUserBrowser( >+ canonical_url(self.project, rootsite='code')) >+ expected_text = ("None of %s's projects are using Launchpad to host " >+ "code." % self.project.displayname) >+ no_branch_div = find_tag_by_id(browser.contents, "no-branchtable") >+ text = extract_text(no_branch_div) > > >You're missing an assertEqual or assertIn here. > > >+ >+ def test_branches_get_listing(self): >+ # If a product has a branch, then the project view has a branch >+ # listing. >+ branch = self.factory.makeProductBranch(product=self.product) >+ browser = self.getUserBrowser( >+ canonical_url(self.project, rootsite='code')) >+ table = find_tag_by_id(browser.contents, "branchtable") >+ self.assertIsNot(None, table) >+ > def test_suite(): > return unittest.TestLoader().loadTestsFromName(__name__) >
« Back to merge proposal
Hi JC,
This branch looks good. I just have one comment below.
-Edwin
>=== modified file 'lib/lp/ code/browser/ tests/test_ branchlisting. py' code/browser/ tests/test_ branchlisting. py 2010-08-24 02:21:50 +0000 code/browser/ tests/test_ branchlisting. py 2010-10-14 14:37:22 +0000 chListing( TestCaseWithFac tory): nalLayer ctBranchListing , self).setUp() makeProject( ) makeProduct( project= self.project) branches_ gets_message_ not_listing( self): wser( url(self. project, rootsite='code')) displayname) by_id(browser. contents, "no-branchtable") text(no_ branch_ div) get_listing( self): makeProductBran ch(product= self.product) wser( url(self. project, rootsite='code')) by_id(browser. contents, "branchtable") t(None, table) TestLoader( ).loadTestsFrom Name(__ name__)
>--- lib/lp/
>+++ lib/lp/
>@@ -421,5 +421,33 @@
> self.assertIs(None, branches)
>
>
>+class TestProjectBran
>+
>+ layer = DatabaseFunctio
>+
>+ def setUp(self):
>+ super(TestProje
>+ self.project = self.factory.
>+ self.product = self.factory.
>+
>+ def test_no_
>+ # If there are no product branches on the project's products, then
>+ # the view shows the no code hosting message instead of a listing.
>+ browser = self.getUserBro
>+ canonical_
>+ expected_text = ("None of %s's projects are using Launchpad to host "
>+ "code." % self.project.
>+ no_branch_div = find_tag_
>+ text = extract_
>
>
>You're missing an assertEqual or assertIn here.
>
>
>+
>+ def test_branches_
>+ # If a product has a branch, then the project view has a branch
>+ # listing.
>+ branch = self.factory.
>+ browser = self.getUserBro
>+ canonical_
>+ table = find_tag_
>+ self.assertIsNo
>+
> def test_suite():
> return unittest.
>