← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/gitref-activereviews-oops into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/gitref-activereviews-oops into lp:launchpad.

Commit message:
Fix GitRef:+activereviews OOPS when there are no active reviews.

Requested reviews:
  Colin Watson (cjwatson)
Related bugs:
  Bug #1499744 in Launchpad itself: "GitRef:+activereviews OOPSes if there are no active reviews"
  https://bugs.launchpad.net/launchpad/+bug/1499744

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/gitref-activereviews-oops/+merge/272404

Fix GitRef:+activereviews OOPS when there are no active reviews.
-- 
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/code/browser/branchmergeproposallisting.py'
--- lib/lp/code/browser/branchmergeproposallisting.py	2015-07-09 20:06:17 +0000
+++ lib/lp/code/browser/branchmergeproposallisting.py	2015-09-25 14:23:24 +0000
@@ -408,7 +408,7 @@
     @property
     def no_proposal_message(self):
         """Shown when there is no table to show."""
-        return "%s has no active code reviews." % self.context.displayname
+        return "%s has no active code reviews." % self.context.display_name
 
 
 class BranchActiveReviewsView(ActiveReviewsView):

=== modified file 'lib/lp/code/browser/tests/test_branchmergeproposallisting.py'
--- lib/lp/code/browser/tests/test_branchmergeproposallisting.py	2015-06-30 02:10:48 +0000
+++ lib/lp/code/browser/tests/test_branchmergeproposallisting.py	2015-09-25 14:23:24 +0000
@@ -500,11 +500,19 @@
     """Test the sorting of the active review groups for Git."""
 
 
-class ActiveReviewsWithPrivateBranchesMixin:
-    """Test reviews of private branches."""
+class ActiveReviewsOfBranchesMixin:
+    """Test reviews of branches."""
 
     layer = DatabaseFunctionalLayer
 
+    def test_no_proposal_message(self):
+        branch = self._makeBranch()
+        view = create_initialized_view(
+            branch, name='+activereviews', rootsite='code')
+        self.assertEqual(
+            "%s has no active code reviews." % branch.display_name,
+            view.no_proposal_message)
+
     def test_private_branch_owner(self):
         # Merge proposals against private branches are visible to
         # the branch owner.
@@ -518,14 +526,14 @@
             self.assertEqual([mp], list(view.getProposals()))
 
 
-class ActiveReviewsWithPrivateBranchesBzr(
-    ActiveReviewsWithPrivateBranchesMixin, BzrMixin, TestCaseWithFactory):
-    """Test reviews of private Bazaar branches."""
-
-
-class ActiveReviewsWithPrivateBranchesGit(
-    ActiveReviewsWithPrivateBranchesMixin, GitMixin, TestCaseWithFactory):
-    """Test reviews of references in private Git repositories."""
+class ActiveReviewsOfBranchesBzr(
+    ActiveReviewsOfBranchesMixin, BzrMixin, TestCaseWithFactory):
+    """Test reviews of Bazaar branches."""
+
+
+class ActiveReviewsOfBranchesGit(
+    ActiveReviewsOfBranchesMixin, GitMixin, TestCaseWithFactory):
+    """Test reviews of references in Git repositories."""
 
 
 class PersonActiveReviewsPerformanceMixin:


References