Merge lp:~blr/launchpad/bug-1536363-codereviewcomment-reply-git-oops into lp:launchpad

Proposed by Kit Randel
Status: Merged
Merged at revision: 17903
Proposed branch: lp:~blr/launchpad/bug-1536363-codereviewcomment-reply-git-oops
Merge into: lp:launchpad
Diff against target: 41 lines (+11/-6)
2 files modified
lib/lp/code/browser/tests/test_codereviewcomment.py (+7/-0)
lib/lp/code/templates/codereviewcomment-reply.pt (+4/-6)
To merge this branch: bzr merge lp:~blr/launchpad/bug-1536363-codereviewcomment-reply-git-oops
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+283382@code.launchpad.net

Commit message

The codereviewcomment-reply template should use the generalised attributes merge_source and identify to render the view correctly for git.

To post a comment you must log in.
Revision history for this message
Kit Randel (blr) wrote :

This test may be too generic, I'm not certain, however it would potentially catch other template errors that a test for this specific issue may not.

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/tests/test_codereviewcomment.py'
2--- lib/lp/code/browser/tests/test_codereviewcomment.py 2015-08-18 08:49:54 +0000
3+++ lib/lp/code/browser/tests/test_codereviewcomment.py 2016-01-21 03:36:24 +0000
4@@ -169,6 +169,13 @@
5 disposition = 'attachment; filename="comment-%d.txt"' % comment.id
6 self.assertEqual(disposition, browser.headers['Content-disposition'])
7
8+ def test_parent_comment_in_reply(self):
9+ """The reply view has the expected contents from the parent comment."""
10+ contents = u'test-comment'.encode('utf-8')
11+ comment = self.makeCodeReviewComment(body=contents)
12+ browser = self.getViewBrowser(comment, view_name='+reply')
13+ self.assertIn(contents, browser.contents)
14+
15
16 class TestCodeReviewCommentHtmlBzr(
17 TestCodeReviewCommentHtmlMixin, BrowserTestCase):
18
19=== modified file 'lib/lp/code/templates/codereviewcomment-reply.pt'
20--- lib/lp/code/templates/codereviewcomment-reply.pt 2009-08-24 02:20:49 +0000
21+++ lib/lp/code/templates/codereviewcomment-reply.pt 2016-01-21 03:36:24 +0000
22@@ -6,15 +6,13 @@
23 metal:use-macro="view/macro:page/main_only"
24 i18n:domain="launchpad">
25
26-<body>
27-
28- <h1 metal:fill-slot="heading"
29- tal:define="branch view/branch_merge_proposal/source_branch">
30- Code review comment for <tal:source content="branch/bzr_identity"/>
31+ <body>
32+ <h1 metal:fill-slot="heading"
33+ tal:define="branch view/branch_merge_proposal/merge_source">
34+ Code review comment for <tal:source content="branch/identity"/>
35 </h1>
36
37 <div metal:fill-slot="main">
38-
39 <tal:previous tal:condition="view/is_reply">
40 <tal:content replace="structure view/reply_to/@@+render"/>
41 </tal:previous>