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

Proposed by Colin Watson
Status: Merged
Merged at revision: 17760
Proposed branch: lp:~cjwatson/launchpad/gitref-activereviews-oops
Merge into: lp:launchpad
Diff against target: 61 lines (+19/-11)
2 files modified
lib/lp/code/browser/branchmergeproposallisting.py (+1/-1)
lib/lp/code/browser/tests/test_branchmergeproposallisting.py (+18/-10)
To merge this branch: bzr merge lp:~cjwatson/launchpad/gitref-activereviews-oops
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+272404@code.launchpad.net

Commit message

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

Description of the change

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

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/branchmergeproposallisting.py'
2--- lib/lp/code/browser/branchmergeproposallisting.py 2015-07-09 20:06:17 +0000
3+++ lib/lp/code/browser/branchmergeproposallisting.py 2015-09-25 14:23:24 +0000
4@@ -408,7 +408,7 @@
5 @property
6 def no_proposal_message(self):
7 """Shown when there is no table to show."""
8- return "%s has no active code reviews." % self.context.displayname
9+ return "%s has no active code reviews." % self.context.display_name
10
11
12 class BranchActiveReviewsView(ActiveReviewsView):
13
14=== modified file 'lib/lp/code/browser/tests/test_branchmergeproposallisting.py'
15--- lib/lp/code/browser/tests/test_branchmergeproposallisting.py 2015-06-30 02:10:48 +0000
16+++ lib/lp/code/browser/tests/test_branchmergeproposallisting.py 2015-09-25 14:23:24 +0000
17@@ -500,11 +500,19 @@
18 """Test the sorting of the active review groups for Git."""
19
20
21-class ActiveReviewsWithPrivateBranchesMixin:
22- """Test reviews of private branches."""
23+class ActiveReviewsOfBranchesMixin:
24+ """Test reviews of branches."""
25
26 layer = DatabaseFunctionalLayer
27
28+ def test_no_proposal_message(self):
29+ branch = self._makeBranch()
30+ view = create_initialized_view(
31+ branch, name='+activereviews', rootsite='code')
32+ self.assertEqual(
33+ "%s has no active code reviews." % branch.display_name,
34+ view.no_proposal_message)
35+
36 def test_private_branch_owner(self):
37 # Merge proposals against private branches are visible to
38 # the branch owner.
39@@ -518,14 +526,14 @@
40 self.assertEqual([mp], list(view.getProposals()))
41
42
43-class ActiveReviewsWithPrivateBranchesBzr(
44- ActiveReviewsWithPrivateBranchesMixin, BzrMixin, TestCaseWithFactory):
45- """Test reviews of private Bazaar branches."""
46-
47-
48-class ActiveReviewsWithPrivateBranchesGit(
49- ActiveReviewsWithPrivateBranchesMixin, GitMixin, TestCaseWithFactory):
50- """Test reviews of references in private Git repositories."""
51+class ActiveReviewsOfBranchesBzr(
52+ ActiveReviewsOfBranchesMixin, BzrMixin, TestCaseWithFactory):
53+ """Test reviews of Bazaar branches."""
54+
55+
56+class ActiveReviewsOfBranchesGit(
57+ ActiveReviewsOfBranchesMixin, GitMixin, TestCaseWithFactory):
58+ """Test reviews of references in Git repositories."""
59
60
61 class PersonActiveReviewsPerformanceMixin: