Changeset - cbfc29a4c363
[Not reviewed]
default
0 2 0
Thomas De Schampheleire - 8 years ago 2018-02-12 09:29:01
thomas.de_schampheleire@nokia.com
email templates: add HTML entities to test strings

An issue is observed in Outlook rendering of HTML emails, where the HTML
entity ' is not recognized and seen as a literal string.

Add some HTML entities to the test strings to be able to see the issue
(after mailing the resulting HTML to an Outlook client)
2 files changed with 17 insertions and 17 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/models/test_dump_html_mails.ref.html
Show inline comments
 
<!doctype html>
 
<html lang="en">
 
<head><title>Notifications</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
 
<body>
 
<hr/>
 
<h1>cs_comment, is_mention=False, status_change=None</h1>
 
<pre>
 
From: u1
 
To: u2@example.com
 
Subject: [Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
 
</pre>
 
<hr/>
 
<pre>http://comment.org
 

	
 
Comment on Changeset "This changeset did something clever which is hard to explain"
 

	
 

	
 
Opinionated User (jsmith):
 

	
 
This is the new comment.
 
This is the new 'comment'.
 

	
 
 - and here it ends indented.
 

	
 

	
 
Changeset on http://example.com/repo_target branch brunch:
 
"This changeset did something clever which is hard to explain" by u2 u3 (u2).
 

	
 

	
 
View Comment: http://comment.org
 
</pre>
 
<hr/>
 
<!--!doctype html-->
 
<!--html lang="en"-->
 
<!--head-->
 
    <!--title--><!--/title-->
 
    <!--meta name="viewport" content="width=device-width"-->
 
    <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 
<!--/head-->
 
<!--body-->
 
<table align="center" cellpadding="0" cellspacing="0" border="0" style="min-width:348px;max-width:800px;font-family:Helvetica,Arial,sans-serif;font-weight:200;font-size:14px;line-height:17px;color:#202020">
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td>
 
            <table width="100%" cellpadding="0" cellspacing="0" border="0"
 
                   style="table-layout:fixed;font-family:Helvetica,Arial,sans-serif;border:1px solid #ddd">
 
                <tr><td width="30px" style="width:30px"></td><td></td><td width="30px" style="width:30px"></td></tr>
 
                <tr>
 
                    <td colspan="3">
 
<table bgcolor="#f9f9f9" width="100%" cellpadding="0" cellspacing="0"
 
       style="border-bottom:1px solid #ddd">
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td style="font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:24px">
 
            <a style="text-decoration:none;font-weight:600;color:#395fa0" href="http://comment.org"
 
               target="_blank">Comment on Changeset &#34;This changeset did something clever which is hard to explain&#34;</a>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
</table>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
                <tr>
 
                    <td></td>
 
                    <td>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td>
 
<table cellpadding="0" cellspacing="0" width="100%" border="0" bgcolor="#f9f9f9" style="border:1px solid #ddd;border-radius:4px">
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-weight:600;color:#395fa0">Opinionated User (jsmith)</div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new comment.<br/><br/> - and here it ends indented.</div></div>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &apos;comment&apos;.<br/><br/> - and here it ends indented.</div></div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
</table>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="30px" style="height:30px"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            <div>
 
                Changeset on
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://example.com/repo_target">http://example.com/repo_target</a>
 
                branch
 
                <span style="color:#395fa0">brunch</span>:
 
            </div>
 
            <div>
 
                "<a style="color:#395fa0;text-decoration:none"
 
                   href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
    <table cellspacing="0" cellpadding="0" style="margin-left:auto;margin-right:auto">
 
        <tr>
 
            <td height="25px" style="height:25px"></td>
 
        </tr>
 
        <tr>
 
            <td style="border-collapse:collapse;border-radius:2px;text-align:center;display:block;border:solid 1px #395fa0;padding:11px 20px 11px 20px">
 
                <a href="http://comment.org" style="text-decoration:none;display:block" target="_blank">
 
                    <center>
 
                        <font size="3">
 
                            <span style="font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:15px;line-height:14px;color:#395fa0;white-space:nowrap;vertical-align:middle">View Comment</span>
 
                        </font>
 
                    </center>
 
                </a>
 
            </td>
 
        </tr>
 
    </table>
 
</center>
 
        </td>
 
    </tr>
 
</table>
 
                    </td>
 
                    <td></td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
            </table>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
</table>
 
<!--/body-->
 
<!--/html-->
 
<hr/>
 
<hr/>
 
<h1>cs_comment, is_mention=True, status_change=None</h1>
 
<pre>
 
From: u1
 
To: u2@example.com
 
Subject: [Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
 
</pre>
 
<hr/>
 
<pre>http://comment.org
 

	
 
Mention in Comment on Changeset "This changeset did something clever which is hard to explain"
 

	
 

	
 
Opinionated User (jsmith):
 

	
 
This is the new comment.
 
This is the new 'comment'.
 

	
 
 - and here it ends indented.
 

	
 

	
 
Changeset on http://example.com/repo_target branch brunch:
 
"This changeset did something clever which is hard to explain" by u2 u3 (u2).
 

	
 

	
 
View Comment: http://comment.org
 
</pre>
 
<hr/>
 
<!--!doctype html-->
 
<!--html lang="en"-->
 
<!--head-->
 
    <!--title--><!--/title-->
 
    <!--meta name="viewport" content="width=device-width"-->
 
    <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 
<!--/head-->
 
<!--body-->
 
<table align="center" cellpadding="0" cellspacing="0" border="0" style="min-width:348px;max-width:800px;font-family:Helvetica,Arial,sans-serif;font-weight:200;font-size:14px;line-height:17px;color:#202020">
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td>
 
            <table width="100%" cellpadding="0" cellspacing="0" border="0"
 
                   style="table-layout:fixed;font-family:Helvetica,Arial,sans-serif;border:1px solid #ddd">
 
                <tr><td width="30px" style="width:30px"></td><td></td><td width="30px" style="width:30px"></td></tr>
 
                <tr>
 
                    <td colspan="3">
 
<table bgcolor="#f9f9f9" width="100%" cellpadding="0" cellspacing="0"
 
       style="border-bottom:1px solid #ddd">
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td style="font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:24px">
 
            <a style="text-decoration:none;font-weight:600;color:#395fa0" href="http://comment.org"
 
               target="_blank">Mention in Comment on Changeset &#34;This changeset did something clever which is hard to explain&#34;</a>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
</table>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
                <tr>
 
                    <td></td>
 
                    <td>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td>
 
<table cellpadding="0" cellspacing="0" width="100%" border="0" bgcolor="#f9f9f9" style="border:1px solid #ddd;border-radius:4px">
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-weight:600;color:#395fa0">Opinionated User (jsmith)</div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new comment.<br/><br/> - and here it ends indented.</div></div>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &apos;comment&apos;.<br/><br/> - and here it ends indented.</div></div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
</table>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="30px" style="height:30px"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            <div>
 
                Changeset on
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://example.com/repo_target">http://example.com/repo_target</a>
 
                branch
 
                <span style="color:#395fa0">brunch</span>:
 
            </div>
 
            <div>
 
                "<a style="color:#395fa0;text-decoration:none"
 
                   href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
    <table cellspacing="0" cellpadding="0" style="margin-left:auto;margin-right:auto">
 
        <tr>
 
            <td height="25px" style="height:25px"></td>
 
        </tr>
 
        <tr>
 
            <td style="border-collapse:collapse;border-radius:2px;text-align:center;display:block;border:solid 1px #395fa0;padding:11px 20px 11px 20px">
 
                <a href="http://comment.org" style="text-decoration:none;display:block" target="_blank">
 
                    <center>
 
                        <font size="3">
 
                            <span style="font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:15px;line-height:14px;color:#395fa0;white-space:nowrap;vertical-align:middle">View Comment</span>
 
                        </font>
 
                    </center>
 
                </a>
 
            </td>
 
        </tr>
 
    </table>
 
</center>
 
        </td>
 
    </tr>
 
</table>
 
                    </td>
 
                    <td></td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
            </table>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
</table>
 
<!--/body-->
 
<!--/html-->
 
<hr/>
 
<hr/>
 
<h1>cs_comment, is_mention=False, status_change='Approved'</h1>
 
<pre>
 
From: u1
 
To: u2@example.com
 
Subject: [Approved: Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
 
</pre>
 
<hr/>
 
<pre>http://comment.org
 

	
 
Comment on Changeset "This changeset did something clever which is hard to explain"
 

	
 

	
 
Opinionated User (jsmith):
 

	
 
Status change: Approved
 

	
 
This is the new comment.
 
This is the new 'comment'.
 

	
 
 - and here it ends indented.
 

	
 

	
 
Changeset on http://example.com/repo_target branch brunch:
 
"This changeset did something clever which is hard to explain" by u2 u3 (u2).
 

	
 

	
 
View Comment: http://comment.org
 
</pre>
 
<hr/>
 
<!--!doctype html-->
 
<!--html lang="en"-->
 
<!--head-->
 
    <!--title--><!--/title-->
 
    <!--meta name="viewport" content="width=device-width"-->
 
    <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 
<!--/head-->
 
<!--body-->
 
<table align="center" cellpadding="0" cellspacing="0" border="0" style="min-width:348px;max-width:800px;font-family:Helvetica,Arial,sans-serif;font-weight:200;font-size:14px;line-height:17px;color:#202020">
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td>
 
            <table width="100%" cellpadding="0" cellspacing="0" border="0"
 
                   style="table-layout:fixed;font-family:Helvetica,Arial,sans-serif;border:1px solid #ddd">
 
                <tr><td width="30px" style="width:30px"></td><td></td><td width="30px" style="width:30px"></td></tr>
 
                <tr>
 
                    <td colspan="3">
 
<table bgcolor="#f9f9f9" width="100%" cellpadding="0" cellspacing="0"
 
       style="border-bottom:1px solid #ddd">
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td style="font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:24px">
 
            <a style="text-decoration:none;font-weight:600;color:#395fa0" href="http://comment.org"
 
               target="_blank">Comment on Changeset &#34;This changeset did something clever which is hard to explain&#34;</a>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
</table>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
                <tr>
 
                    <td></td>
 
                    <td>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td>
 
<table cellpadding="0" cellspacing="0" width="100%" border="0" bgcolor="#f9f9f9" style="border:1px solid #ddd;border-radius:4px">
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-weight:600;color:#395fa0">Opinionated User (jsmith)</div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
    </tr>
 
        <tr>
 
            <td height="10px" style="height:10px" colspan="3"></td>
 
        </tr>
 
        <tr>
 
            <td width="20px" style="width:20px"></td>
 
            <td>
 
                    <div style="font-weight:600">
 
                        Status change:
 
                        Approved
 
                    </div>
 
            </td>
 
            <td width="20px" style="width:20px"></td>
 
        </tr>
 
        <tr>
 
            <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
        </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new comment.<br/><br/> - and here it ends indented.</div></div>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &apos;comment&apos;.<br/><br/> - and here it ends indented.</div></div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
</table>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="30px" style="height:30px"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            <div>
 
                Changeset on
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://example.com/repo_target">http://example.com/repo_target</a>
 
                branch
 
                <span style="color:#395fa0">brunch</span>:
 
            </div>
 
            <div>
 
                "<a style="color:#395fa0;text-decoration:none"
 
                   href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
    <table cellspacing="0" cellpadding="0" style="margin-left:auto;margin-right:auto">
 
        <tr>
 
            <td height="25px" style="height:25px"></td>
 
        </tr>
 
        <tr>
 
            <td style="border-collapse:collapse;border-radius:2px;text-align:center;display:block;border:solid 1px #395fa0;padding:11px 20px 11px 20px">
 
                <a href="http://comment.org" style="text-decoration:none;display:block" target="_blank">
 
                    <center>
 
                        <font size="3">
 
                            <span style="font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:15px;line-height:14px;color:#395fa0;white-space:nowrap;vertical-align:middle">View Comment</span>
 
                        </font>
 
                    </center>
 
                </a>
 
            </td>
 
        </tr>
 
    </table>
 
</center>
 
        </td>
 
    </tr>
 
</table>
 
                    </td>
 
                    <td></td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
            </table>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
</table>
 
<!--/body-->
 
<!--/html-->
 
<hr/>
 
<hr/>
 
<h1>cs_comment, is_mention=True, status_change='Approved'</h1>
 
<pre>
 
From: u1
 
To: u2@example.com
 
Subject: [Approved: Comment] repo/name changeset cafe1234 "This changeset did something cl..." on brunch
 
</pre>
 
<hr/>
 
<pre>http://comment.org
 

	
 
Mention in Comment on Changeset "This changeset did something clever which is hard to explain"
 

	
 

	
 
Opinionated User (jsmith):
 

	
 
Status change: Approved
 

	
 
This is the new comment.
 
This is the new 'comment'.
 

	
 
 - and here it ends indented.
 

	
 

	
 
Changeset on http://example.com/repo_target branch brunch:
 
"This changeset did something clever which is hard to explain" by u2 u3 (u2).
 

	
 

	
 
View Comment: http://comment.org
 
</pre>
 
<hr/>
 
<!--!doctype html-->
 
<!--html lang="en"-->
 
<!--head-->
 
    <!--title--><!--/title-->
 
    <!--meta name="viewport" content="width=device-width"-->
 
    <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 
<!--/head-->
 
<!--body-->
 
<table align="center" cellpadding="0" cellspacing="0" border="0" style="min-width:348px;max-width:800px;font-family:Helvetica,Arial,sans-serif;font-weight:200;font-size:14px;line-height:17px;color:#202020">
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td>
 
            <table width="100%" cellpadding="0" cellspacing="0" border="0"
 
                   style="table-layout:fixed;font-family:Helvetica,Arial,sans-serif;border:1px solid #ddd">
 
                <tr><td width="30px" style="width:30px"></td><td></td><td width="30px" style="width:30px"></td></tr>
 
                <tr>
 
                    <td colspan="3">
 
<table bgcolor="#f9f9f9" width="100%" cellpadding="0" cellspacing="0"
 
       style="border-bottom:1px solid #ddd">
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td style="font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:24px">
 
            <a style="text-decoration:none;font-weight:600;color:#395fa0" href="http://comment.org"
 
               target="_blank">Mention in Comment on Changeset &#34;This changeset did something clever which is hard to explain&#34;</a>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
</table>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
                <tr>
 
                    <td></td>
 
                    <td>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td>
 
<table cellpadding="0" cellspacing="0" width="100%" border="0" bgcolor="#f9f9f9" style="border:1px solid #ddd;border-radius:4px">
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-weight:600;color:#395fa0">Opinionated User (jsmith)</div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
    </tr>
 
        <tr>
 
            <td height="10px" style="height:10px" colspan="3"></td>
 
        </tr>
 
        <tr>
 
            <td width="20px" style="width:20px"></td>
 
            <td>
 
                    <div style="font-weight:600">
 
                        Status change:
 
                        Approved
 
                    </div>
 
            </td>
 
            <td width="20px" style="width:20px"></td>
 
        </tr>
 
        <tr>
 
            <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
        </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new comment.<br/><br/> - and here it ends indented.</div></div>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &apos;comment&apos;.<br/><br/> - and here it ends indented.</div></div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
</table>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="30px" style="height:30px"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            <div>
 
                Changeset on
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://example.com/repo_target">http://example.com/repo_target</a>
 
                branch
 
                <span style="color:#395fa0">brunch</span>:
 
            </div>
 
            <div>
 
                "<a style="color:#395fa0;text-decoration:none"
 
                   href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
    <table cellspacing="0" cellpadding="0" style="margin-left:auto;margin-right:auto">
 
        <tr>
 
            <td height="25px" style="height:25px"></td>
 
        </tr>
 
        <tr>
 
            <td style="border-collapse:collapse;border-radius:2px;text-align:center;display:block;border:solid 1px #395fa0;padding:11px 20px 11px 20px">
 
                <a href="http://comment.org" style="text-decoration:none;display:block" target="_blank">
 
                    <center>
 
                        <font size="3">
 
                            <span style="font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:15px;line-height:14px;color:#395fa0;white-space:nowrap;vertical-align:middle">View Comment</span>
 
                        </font>
 
                    </center>
 
                </a>
 
            </td>
 
        </tr>
 
    </table>
 
</center>
 
        </td>
 
    </tr>
 
</table>
 
                    </td>
 
                    <td></td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
            </table>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
</table>
 
<!--/body-->
 
<!--/html-->
 
<hr/>
 
<hr/>
 
<h1>message</h1>
 
<pre>
 
From: u1
 
To: u2@example.com
 
Subject: Test Message
 
</pre>
 
<hr/>
 
<pre>This is the body of the test message
 
<pre>This is the 'body' of the "test" message
 
 - nothing interesting here except indentation.</pre>
 
<hr/>
 
<!--!doctype html-->
 
<!--html lang="en"-->
 
<!--head-->
 
    <!--title--><!--/title-->
 
    <!--meta name="viewport" content="width=device-width"-->
 
    <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 
<!--/head-->
 
<!--body-->
 
<table align="center" cellpadding="0" cellspacing="0" border="0" style="min-width:348px;max-width:800px;font-family:Helvetica,Arial,sans-serif;font-weight:200;font-size:14px;line-height:17px;color:#202020">
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td>
 
            <table width="100%" cellpadding="0" cellspacing="0" border="0"
 
                   style="table-layout:fixed;font-family:Helvetica,Arial,sans-serif;border:1px solid #ddd">
 
                <tr><td width="30px" style="width:30px"></td><td></td><td width="30px" style="width:30px"></td></tr>
 
                <tr>
 
                    <td colspan="3">
 
<table bgcolor="#f9f9f9" width="100%" cellpadding="0" cellspacing="0"
 
       style="border-bottom:1px solid #ddd">
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td style="font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:24px">
 
            <span style="font-weight:600;color:#395fa0">Message</span>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
</table>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
                <tr>
 
                    <td></td>
 
                    <td>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the body of the test message<br/> - nothing interesting here except indentation.</div></td>
 
        <td style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the &apos;body&apos; of the &quot;test&quot; message<br/> - nothing interesting here except indentation.</div></td>
 
    </tr>
 
</table>
 
                    </td>
 
                    <td></td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
            </table>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
</table>
 
<!--/body-->
 
<!--/html-->
 
<hr/>
 
<hr/>
 
<h1>registration</h1>
 
<pre>
 
From: u1
 
To: u2@example.com
 
Subject: New user newbie registered
 
</pre>
 
<hr/>
 
<pre>http://newbie.org
 

	
 
New User Registration
 

	
 

	
 
Username: newbie
 

	
 
Full Name: New Full Name
 

	
 
Email: new@email.com
 

	
 

	
 
View User Profile: http://newbie.org
 
</pre>
 
<hr/>
 
<!--!doctype html-->
 
<!--html lang="en"-->
 
<!--head-->
 
    <!--title--><!--/title-->
 
    <!--meta name="viewport" content="width=device-width"-->
 
    <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 
<!--/head-->
 
<!--body-->
 
<table align="center" cellpadding="0" cellspacing="0" border="0" style="min-width:348px;max-width:800px;font-family:Helvetica,Arial,sans-serif;font-weight:200;font-size:14px;line-height:17px;color:#202020">
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td>
 
            <table width="100%" cellpadding="0" cellspacing="0" border="0"
 
                   style="table-layout:fixed;font-family:Helvetica,Arial,sans-serif;border:1px solid #ddd">
 
                <tr><td width="30px" style="width:30px"></td><td></td><td width="30px" style="width:30px"></td></tr>
 
                <tr>
 
                    <td colspan="3">
 
<table bgcolor="#f9f9f9" width="100%" cellpadding="0" cellspacing="0"
 
       style="border-bottom:1px solid #ddd">
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td style="font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:24px">
 
            <a style="text-decoration:none;font-weight:600;color:#395fa0" href="http://newbie.org"
 
               target="_blank">New User Registration</a>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
</table>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
                <tr>
 
                    <td></td>
 
                    <td>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td>
 
            Username:
 
        </td>
 
        <td style="color:#395fa0">
 
            newbie
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="2"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            Full Name:
 
        </td>
 
        <td style="color:#395fa0">
 
            New Full Name
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="2"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            Email:
 
        </td>
 
        <td style="color:#395fa0">
 
            new@email.com
 
        </td>
 
    </tr>
 
    <tr>
 
        <td colspan="2">
 
<center>
 
    <table cellspacing="0" cellpadding="0" style="margin-left:auto;margin-right:auto">
 
        <tr>
 
            <td height="25px" style="height:25px"></td>
 
        </tr>
 
        <tr>
 
            <td style="border-collapse:collapse;border-radius:2px;text-align:center;display:block;border:solid 1px #395fa0;padding:11px 20px 11px 20px">
 
                <a href="http://newbie.org" style="text-decoration:none;display:block" target="_blank">
 
                    <center>
 
                        <font size="3">
 
                            <span style="font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:15px;line-height:14px;color:#395fa0;white-space:nowrap;vertical-align:middle">View User Profile</span>
 
                        </font>
 
                    </center>
 
                </a>
 
            </td>
 
        </tr>
 
    </table>
 
</center>
 
        </td>
 
    </tr>
 
</table>
 
                    </td>
 
                    <td></td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
            </table>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
</table>
 
<!--/body-->
 
<!--/html-->
 
<hr/>
 
<hr/>
 
<h1>pull_request, is_mention=False</h1>
 
<pre>
 
From: u1
 
To: u2@example.com
 
Subject: [Review] repo/name PR #7 "The Title" from devbranch by u2
 
</pre>
 
<hr/>
 
<pre>http://pr.org/7
 

	
 
Added as Reviewer of Pull Request #7 "The Title" by Requesting User (root)
 

	
 

	
 
Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
 
#7 "The Title" by u2 u3 (u2).
 

	
 

	
 
Description:
 

	
 
This PR is awesome because it does stuff
 
This PR is 'awesome' because it does <stuff>
 
 - please approve indented!
 

	
 

	
 
Changesets:
 

	
 
Introduce one and two
 
Make one plus two equal tree
 

	
 

	
 
View Pull Request: http://pr.org/7
 
</pre>
 
<hr/>
 
<!--!doctype html-->
 
<!--html lang="en"-->
 
<!--head-->
 
    <!--title--><!--/title-->
 
    <!--meta name="viewport" content="width=device-width"-->
 
    <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 
<!--/head-->
 
<!--body-->
 
<table align="center" cellpadding="0" cellspacing="0" border="0" style="min-width:348px;max-width:800px;font-family:Helvetica,Arial,sans-serif;font-weight:200;font-size:14px;line-height:17px;color:#202020">
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td>
 
            <table width="100%" cellpadding="0" cellspacing="0" border="0"
 
                   style="table-layout:fixed;font-family:Helvetica,Arial,sans-serif;border:1px solid #ddd">
 
                <tr><td width="30px" style="width:30px"></td><td></td><td width="30px" style="width:30px"></td></tr>
 
                <tr>
 
                    <td colspan="3">
 
<table bgcolor="#f9f9f9" width="100%" cellpadding="0" cellspacing="0"
 
       style="border-bottom:1px solid #ddd">
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td style="font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:24px">
 
            <a style="text-decoration:none;font-weight:600;color:#395fa0" href="http://pr.org/7"
 
               target="_blank">Added as Reviewer of Pull Request #7 &#34;The Title&#34; by Requesting User (root)</a>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
</table>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
                <tr>
 
                    <td></td>
 
                    <td>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                at
 
                <span style="color:#395fa0">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                at
 
                <span style="color:#395fa0">trunk</span>:
 
            </div>
 
            <div>
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://pr.org/7">#7</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 
    <tr>
 
        <td>
 
            <div>
 
                Description:
 
            </div>
 
        </td>
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 
    <tr>
 
        <td>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap;color:#395fa0"><div class="formatted-fixed">This PR is awesome because it does stuff<br/> - please approve indented!</div></div>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap;color:#395fa0"><div class="formatted-fixed">This PR is &apos;awesome&apos; because it does &lt;stuff&gt;<br/> - please approve indented!</div></div>
 
        </td>
 
    </tr>
 
    <tr><td height="15px" style="height:15px"></td></tr>
 
    <tr>
 
        <td>
 
            <div>Changesets:</div>
 
        </td>
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 

	
 
    <tr>
 
        <td style="font-family:Helvetica,Arial,sans-serif">
 
            <ul style="color:#395fa0;padding-left:15px;margin:0">
 
                    <li style="mso-special-format:bullet">
 
                        <a style="color:#395fa0;text-decoration:none"
 
                           href="http://changeset_home/?repo_name=repo_org&amp;revision=123abc123abc123abc123abc123abc123abc123abc">
 
                            Introduce one and two
 
                        </a>
 
                    </li>
 
                    <li style="mso-special-format:bullet">
 
                        <a style="color:#395fa0;text-decoration:none"
 
                           href="http://changeset_home/?repo_name=repo_org&amp;revision=567fed567fed567fed567fed567fed567fed567fed">
 
                            Make one plus two equal tree
 
                        </a>
 
                    </li>
 
            </ul>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
    <table cellspacing="0" cellpadding="0" style="margin-left:auto;margin-right:auto">
 
        <tr>
 
            <td height="25px" style="height:25px"></td>
 
        </tr>
 
        <tr>
 
            <td style="border-collapse:collapse;border-radius:2px;text-align:center;display:block;border:solid 1px #395fa0;padding:11px 20px 11px 20px">
 
                <a href="http://pr.org/7" style="text-decoration:none;display:block" target="_blank">
 
                    <center>
 
                        <font size="3">
 
                            <span style="font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:15px;line-height:14px;color:#395fa0;white-space:nowrap;vertical-align:middle">View Pull Request</span>
 
                        </font>
 
                    </center>
 
                </a>
 
            </td>
 
        </tr>
 
    </table>
 
</center>
 
        </td>
 
    </tr>
 
</table>
 
                    </td>
 
                    <td></td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
            </table>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
</table>
 
<!--/body-->
 
<!--/html-->
 
<hr/>
 
<hr/>
 
<h1>pull_request, is_mention=True</h1>
 
<pre>
 
From: u1
 
To: u2@example.com
 
Subject: [Review] repo/name PR #7 "The Title" from devbranch by u2
 
</pre>
 
<hr/>
 
<pre>http://pr.org/7
 

	
 
Mention on Pull Request #7 "The Title" by Requesting User (root)
 

	
 

	
 
Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
 
#7 "The Title" by u2 u3 (u2).
 

	
 

	
 
Description:
 

	
 
This PR is awesome because it does stuff
 
This PR is 'awesome' because it does <stuff>
 
 - please approve indented!
 

	
 

	
 
Changesets:
 

	
 
Introduce one and two
 
Make one plus two equal tree
 

	
 

	
 
View Pull Request: http://pr.org/7
 
</pre>
 
<hr/>
 
<!--!doctype html-->
 
<!--html lang="en"-->
 
<!--head-->
 
    <!--title--><!--/title-->
 
    <!--meta name="viewport" content="width=device-width"-->
 
    <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 
<!--/head-->
 
<!--body-->
 
<table align="center" cellpadding="0" cellspacing="0" border="0" style="min-width:348px;max-width:800px;font-family:Helvetica,Arial,sans-serif;font-weight:200;font-size:14px;line-height:17px;color:#202020">
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td>
 
            <table width="100%" cellpadding="0" cellspacing="0" border="0"
 
                   style="table-layout:fixed;font-family:Helvetica,Arial,sans-serif;border:1px solid #ddd">
 
                <tr><td width="30px" style="width:30px"></td><td></td><td width="30px" style="width:30px"></td></tr>
 
                <tr>
 
                    <td colspan="3">
 
<table bgcolor="#f9f9f9" width="100%" cellpadding="0" cellspacing="0"
 
       style="border-bottom:1px solid #ddd">
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td style="font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:24px">
 
            <a style="text-decoration:none;font-weight:600;color:#395fa0" href="http://pr.org/7"
 
               target="_blank">Mention on Pull Request #7 &#34;The Title&#34; by Requesting User (root)</a>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
</table>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
                <tr>
 
                    <td></td>
 
                    <td>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                at
 
                <span style="color:#395fa0">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                at
 
                <span style="color:#395fa0">trunk</span>:
 
            </div>
 
            <div>
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://pr.org/7">#7</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 
    <tr>
 
        <td>
 
            <div>
 
                Description:
 
            </div>
 
        </td>
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 
    <tr>
 
        <td>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap;color:#395fa0"><div class="formatted-fixed">This PR is awesome because it does stuff<br/> - please approve indented!</div></div>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap;color:#395fa0"><div class="formatted-fixed">This PR is &apos;awesome&apos; because it does &lt;stuff&gt;<br/> - please approve indented!</div></div>
 
        </td>
 
    </tr>
 
    <tr><td height="15px" style="height:15px"></td></tr>
 
    <tr>
 
        <td>
 
            <div>Changesets:</div>
 
        </td>
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 

	
 
    <tr>
 
        <td style="font-family:Helvetica,Arial,sans-serif">
 
            <ul style="color:#395fa0;padding-left:15px;margin:0">
 
                    <li style="mso-special-format:bullet">
 
                        <a style="color:#395fa0;text-decoration:none"
 
                           href="http://changeset_home/?repo_name=repo_org&amp;revision=123abc123abc123abc123abc123abc123abc123abc">
 
                            Introduce one and two
 
                        </a>
 
                    </li>
 
                    <li style="mso-special-format:bullet">
 
                        <a style="color:#395fa0;text-decoration:none"
 
                           href="http://changeset_home/?repo_name=repo_org&amp;revision=567fed567fed567fed567fed567fed567fed567fed">
 
                            Make one plus two equal tree
 
                        </a>
 
                    </li>
 
            </ul>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
    <table cellspacing="0" cellpadding="0" style="margin-left:auto;margin-right:auto">
 
        <tr>
 
            <td height="25px" style="height:25px"></td>
 
        </tr>
 
        <tr>
 
            <td style="border-collapse:collapse;border-radius:2px;text-align:center;display:block;border:solid 1px #395fa0;padding:11px 20px 11px 20px">
 
                <a href="http://pr.org/7" style="text-decoration:none;display:block" target="_blank">
 
                    <center>
 
                        <font size="3">
 
                            <span style="font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:15px;line-height:14px;color:#395fa0;white-space:nowrap;vertical-align:middle">View Pull Request</span>
 
                        </font>
 
                    </center>
 
                </a>
 
            </td>
 
        </tr>
 
    </table>
 
</center>
 
        </td>
 
    </tr>
 
</table>
 
                    </td>
 
                    <td></td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
            </table>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
</table>
 
<!--/body-->
 
<!--/html-->
 
<hr/>
 
<hr/>
 
<h1>pull_request_comment, is_mention=False, status_change=None, closing_pr=False</h1>
 
<pre>
 
From: u1
 
To: u2@example.com
 
Subject: [Comment] repo/name PR #7 "The Title" from devbranch by u2
 
</pre>
 
<hr/>
 
<pre>http://pr.org/comment
 

	
 
Comment on Pull Request #7 "The Title"
 

	
 

	
 
Opinionated User (jsmith):
 

	
 
Me too!
 

	
 
 - and indented on second line
 

	
 

	
 
Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
 
#7 "The Title" by u2 u3 (u2).
 

	
 

	
 
View Comment: http://pr.org/comment
 
</pre>
 
<hr/>
 
<!--!doctype html-->
 
<!--html lang="en"-->
 
<!--head-->
 
    <!--title--><!--/title-->
 
    <!--meta name="viewport" content="width=device-width"-->
 
    <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 
<!--/head-->
 
<!--body-->
 
<table align="center" cellpadding="0" cellspacing="0" border="0" style="min-width:348px;max-width:800px;font-family:Helvetica,Arial,sans-serif;font-weight:200;font-size:14px;line-height:17px;color:#202020">
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td>
 
            <table width="100%" cellpadding="0" cellspacing="0" border="0"
 
                   style="table-layout:fixed;font-family:Helvetica,Arial,sans-serif;border:1px solid #ddd">
 
                <tr><td width="30px" style="width:30px"></td><td></td><td width="30px" style="width:30px"></td></tr>
 
                <tr>
 
                    <td colspan="3">
 
<table bgcolor="#f9f9f9" width="100%" cellpadding="0" cellspacing="0"
 
       style="border-bottom:1px solid #ddd">
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td style="font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:24px">
 
            <a style="text-decoration:none;font-weight:600;color:#395fa0" href="http://pr.org/comment"
 
               target="_blank">Comment on Pull Request #7 &#34;The Title&#34;</a>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
</table>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
                <tr>
 
                    <td></td>
 
                    <td>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td>
 
<table cellpadding="0" cellspacing="0" width="100%" border="0" bgcolor="#f9f9f9" style="border:1px solid #ddd;border-radius:4px">
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-weight:600;color:#395fa0">Opinionated User (jsmith)</div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">Me too!<br/><br/> - and indented on second line</div></div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
</table>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="30px" style="height:30px"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                branch
 
                <span style="color:#395fa0">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                branch
 
                <span style="color:#395fa0">trunk</span>:
 
            </div>
 
            <div>
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://pr.org/7">#7</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
    <table cellspacing="0" cellpadding="0" style="margin-left:auto;margin-right:auto">
 
        <tr>
 
            <td height="25px" style="height:25px"></td>
 
        </tr>
 
        <tr>
 
            <td style="border-collapse:collapse;border-radius:2px;text-align:center;display:block;border:solid 1px #395fa0;padding:11px 20px 11px 20px">
 
                <a href="http://pr.org/comment" style="text-decoration:none;display:block" target="_blank">
 
                    <center>
 
                        <font size="3">
 
                            <span style="font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:15px;line-height:14px;color:#395fa0;white-space:nowrap;vertical-align:middle">View Comment</span>
 
                        </font>
 
                    </center>
 
                </a>
 
            </td>
 
        </tr>
 
    </table>
 
</center>
 
        </td>
 
    </tr>
 
</table>
 
                    </td>
 
                    <td></td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
            </table>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
</table>
 
<!--/body-->
 
<!--/html-->
 
<hr/>
 
<hr/>
 
<h1>pull_request_comment, is_mention=True, status_change=None, closing_pr=False</h1>
 
<pre>
 
From: u1
 
To: u2@example.com
 
Subject: [Comment] repo/name PR #7 "The Title" from devbranch by u2
 
</pre>
 
<hr/>
 
<pre>http://pr.org/comment
 

	
 
Mention in Comment on Pull Request #7 "The Title"
 

	
 

	
 
Opinionated User (jsmith):
 

	
 
Me too!
 

	
 
 - and indented on second line
 

	
 

	
 
Pull request from https://dev.org/repo at devbranch to http://mainline.com/repo at trunk:
 
#7 "The Title" by u2 u3 (u2).
 

	
 

	
 
View Comment: http://pr.org/comment
 
</pre>
 
<hr/>
 
<!--!doctype html-->
 
<!--html lang="en"-->
 
<!--head-->
 
    <!--title--><!--/title-->
 
    <!--meta name="viewport" content="width=device-width"-->
 
    <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"-->
 
<!--/head-->
 
<!--body-->
 
<table align="center" cellpadding="0" cellspacing="0" border="0" style="min-width:348px;max-width:800px;font-family:Helvetica,Arial,sans-serif;font-weight:200;font-size:14px;line-height:17px;color:#202020">
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td>
 
            <table width="100%" cellpadding="0" cellspacing="0" border="0"
 
                   style="table-layout:fixed;font-family:Helvetica,Arial,sans-serif;border:1px solid #ddd">
 
                <tr><td width="30px" style="width:30px"></td><td></td><td width="30px" style="width:30px"></td></tr>
 
                <tr>
 
                    <td colspan="3">
 
<table bgcolor="#f9f9f9" width="100%" cellpadding="0" cellspacing="0"
 
       style="border-bottom:1px solid #ddd">
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="30px" style="width:30px"></td>
 
        <td style="font-family:Helvetica,Arial,sans-serif;font-size:19px;line-height:24px">
 
            <a style="text-decoration:none;font-weight:600;color:#395fa0" href="http://pr.org/comment"
 
               target="_blank">Mention in Comment on Pull Request #7 &#34;The Title&#34;</a>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
    <tr>
 
        <td height="20px" style="height:20px" colspan="3"></td>
 
    </tr>
 
</table>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
                <tr>
 
                    <td></td>
 
                    <td>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td>
 
<table cellpadding="0" cellspacing="0" width="100%" border="0" bgcolor="#f9f9f9" style="border:1px solid #ddd;border-radius:4px">
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-weight:600;color:#395fa0">Opinionated User (jsmith)</div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <tr>
 
        <td width="20px" style="width:20px"></td>
 
        <td>
 
            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">Me too!<br/><br/> - and indented on second line</div></div>
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
</table>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="30px" style="height:30px"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                branch
 
                <span style="color:#395fa0">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                branch
 
                <span style="color:#395fa0">trunk</span>:
 
            </div>
 
            <div>
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://pr.org/7">#7</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
    <table cellspacing="0" cellpadding="0" style="margin-left:auto;margin-right:auto">
 
        <tr>
 
            <td height="25px" style="height:25px"></td>
 
        </tr>
 
        <tr>
 
            <td style="border-collapse:collapse;border-radius:2px;text-align:center;display:block;border:solid 1px #395fa0;padding:11px 20px 11px 20px">
 
                <a href="http://pr.org/comment" style="text-decoration:none;display:block" target="_blank">
 
                    <center>
 
                        <font size="3">
 
                            <span style="font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:15px;line-height:14px;color:#395fa0;white-space:nowrap;vertical-align:middle">View Comment</span>
 
                        </font>
 
                    </center>
 
                </a>
 
            </td>
 
        </tr>
 
    </table>
 
</center>
 
        </td>
 
    </tr>
 
</table>
 
                    </td>
 
                    <td></td>
 
                </tr>
kallithea/tests/models/test_notifications.py
Show inline comments
 
import os
 
import re
 

	
 
import mock
 
import routes.util
 

	
 
from kallithea.tests.base import *
 
from kallithea.lib import helpers as h
 
from kallithea.model.db import User, Notification, UserNotification
 
from kallithea.model.user import UserModel
 
from kallithea.model.meta import Session
 
from kallithea.model.notification import NotificationModel, EmailNotificationModel
 

	
 
import kallithea.lib.celerylib
 
import kallithea.lib.celerylib.tasks
 

	
 
from tg.util.webtest import test_context
 

	
 

	
 
class TestNotifications(TestController):
 

	
 
    def setup_method(self, method):
 
        Session.remove()
 
        u1 = UserModel().create_or_update(username=u'u1',
 
                                        password=u'qweqwe',
 
                                        email=u'u1@example.com',
 
                                        firstname=u'u1', lastname=u'u1')
 
        Session().commit()
 
        self.u1 = u1.user_id
 

	
 
        u2 = UserModel().create_or_update(username=u'u2',
 
                                        password=u'qweqwe',
 
                                        email=u'u2@example.com',
 
                                        firstname=u'u2', lastname=u'u3')
 
        Session().commit()
 
        self.u2 = u2.user_id
 

	
 
        u3 = UserModel().create_or_update(username=u'u3',
 
                                        password=u'qweqwe',
 
                                        email=u'u3@example.com',
 
                                        firstname=u'u3', lastname=u'u3')
 
        Session().commit()
 
        self.u3 = u3.user_id
 

	
 
        self.remove_all_notifications()
 
        assert [] == Notification.query().all()
 
        assert [] == UserNotification.query().all()
 

	
 
    def test_create_notification(self):
 
        with test_context(self.app):
 
            usrs = [self.u1, self.u2]
 

	
 
            def send_email(recipients, subject, body='', html_body='', headers=None, author=None):
 
                assert recipients == ['u2@example.com']
 
                assert subject == 'Test Message'
 
                assert body == u"hi there"
 
                assert '>hi there<' in html_body
 
                assert author.username == 'u1'
 
            with mock.patch.object(kallithea.lib.celerylib.tasks, 'send_email', send_email):
 
                notification = NotificationModel().create(created_by=self.u1,
 
                                                   subject=u'subj', body=u'hi there',
 
                                                   recipients=usrs)
 
                Session().commit()
 
                u1 = User.get(self.u1)
 
                u2 = User.get(self.u2)
 
                u3 = User.get(self.u3)
 
                notifications = Notification.query().all()
 
                assert len(notifications) == 1
 

	
 
                assert notifications[0].recipients == [u1, u2]
 
                assert notification.notification_id == notifications[0].notification_id
 

	
 
                unotification = UserNotification.query() \
 
                    .filter(UserNotification.notification == notification).all()
 

	
 
                assert len(unotification) == len(usrs)
 
                assert set([x.user_id for x in unotification]) == set(usrs)
 

	
 
    def test_user_notifications(self):
 
        with test_context(self.app):
 
            notification1 = NotificationModel().create(created_by=self.u1,
 
                                                subject=u'subj', body=u'hi there1',
 
                                                recipients=[self.u3])
 
            Session().commit()
 
            notification2 = NotificationModel().create(created_by=self.u1,
 
                                                subject=u'subj', body=u'hi there2',
 
                                                recipients=[self.u3])
 
            Session().commit()
 
            u3 = Session().query(User).get(self.u3)
 

	
 
            assert sorted([x.notification for x in u3.notifications]) == sorted([notification2, notification1])
 

	
 
    def test_delete_notifications(self):
 
        with test_context(self.app):
 
            notification = NotificationModel().create(created_by=self.u1,
 
                                               subject=u'title', body=u'hi there3',
 
                                        recipients=[self.u3, self.u1, self.u2])
 
            Session().commit()
 
            notifications = Notification.query().all()
 
            assert notification in notifications
 

	
 
            Notification.delete(notification.notification_id)
 
            Session().commit()
 

	
 
            notifications = Notification.query().all()
 
            assert notification not in notifications
 

	
 
            un = UserNotification.query().filter(UserNotification.notification
 
                                                 == notification).all()
 
            assert un == []
 

	
 
    def test_delete_association(self):
 
        with test_context(self.app):
 
            notification = NotificationModel().create(created_by=self.u1,
 
                                               subject=u'title', body=u'hi there3',
 
                                        recipients=[self.u3, self.u1, self.u2])
 
            Session().commit()
 

	
 
            unotification = UserNotification.query() \
 
                                .filter(UserNotification.notification ==
 
                                        notification) \
 
                                .filter(UserNotification.user_id == self.u3) \
 
                                .scalar()
 

	
 
            assert unotification.user_id == self.u3
 

	
 
            NotificationModel().delete(self.u3,
 
                                       notification.notification_id)
 
            Session().commit()
 

	
 
            u3notification = UserNotification.query() \
 
                                .filter(UserNotification.notification ==
 
                                        notification) \
 
                                .filter(UserNotification.user_id == self.u3) \
 
                                .scalar()
 

	
 
            assert u3notification == None
 

	
 
            # notification object is still there
 
            assert Notification.query().all() == [notification]
 

	
 
            # u1 and u2 still have assignments
 
            u1notification = UserNotification.query() \
 
                                .filter(UserNotification.notification ==
 
                                        notification) \
 
                                .filter(UserNotification.user_id == self.u1) \
 
                                .scalar()
 
            assert u1notification != None
 
            u2notification = UserNotification.query() \
 
                                .filter(UserNotification.notification ==
 
                                        notification) \
 
                                .filter(UserNotification.user_id == self.u2) \
 
                                .scalar()
 
            assert u2notification != None
 

	
 
    def test_notification_counter(self):
 
        with test_context(self.app):
 
            NotificationModel().create(created_by=self.u1,
 
                                subject=u'title', body=u'hi there_delete',
 
                                recipients=[self.u3, self.u1])
 
            Session().commit()
 

	
 
            assert NotificationModel().get_unread_cnt_for_user(self.u1) == 0
 
            assert NotificationModel().get_unread_cnt_for_user(self.u2) == 0
 
            assert NotificationModel().get_unread_cnt_for_user(self.u3) == 1
 

	
 
            notification = NotificationModel().create(created_by=self.u1,
 
                                               subject=u'title', body=u'hi there3',
 
                                        recipients=[self.u3, self.u1, self.u2])
 
            Session().commit()
 

	
 
            assert NotificationModel().get_unread_cnt_for_user(self.u1) == 0
 
            assert NotificationModel().get_unread_cnt_for_user(self.u2) == 1
 
            assert NotificationModel().get_unread_cnt_for_user(self.u3) == 2
 

	
 
    @mock.patch.object(h, 'canonical_url', (lambda arg, **kwargs: 'http://%s/?%s' % (arg, '&'.join('%s=%s' % (k, v) for (k, v) in sorted(kwargs.items())))))
 
    def test_dump_html_mails(self):
 
        # Exercise all notification types and dump them to one big html file
 
        l = []
 

	
 
        def send_email(recipients, subject, body='', html_body='', headers=None, author=None):
 
            l.append('<hr/>\n')
 
            l.append('<h1>%s</h1>\n' % desc) # desc is from outer scope
 
            l.append('<pre>\n')
 
            l.append('From: %s\n' % author.username)
 
            l.append('To: %s\n' % ' '.join(recipients))
 
            l.append('Subject: %s\n' % subject)
 
            l.append('</pre>\n')
 
            l.append('<hr/>\n')
 
            l.append('<pre>%s</pre>\n' % body)
 
            l.append('<hr/>\n')
 
            l.append(html_body)
 
            l.append('<hr/>\n')
 

	
 
        with test_context(self.app):
 
            with mock.patch.object(kallithea.lib.celerylib.tasks, 'send_email', send_email):
 
                pr_kwargs = dict(
 
                    pr_nice_id='#7',
 
                    pr_title='The Title',
 
                    pr_title_short='The Title',
 
                    pr_url='http://pr.org/7',
 
                    pr_target_repo='http://mainline.com/repo',
 
                    pr_target_branch='trunk',
 
                    pr_source_repo='https://dev.org/repo',
 
                    pr_source_branch='devbranch',
 
                    pr_owner=User.get(self.u2),
 
                    pr_owner_username='u2'
 
                    )
 

	
 
                for type_, body, kwargs in [
 
                    (Notification.TYPE_CHANGESET_COMMENT,
 
                     u'This is the new comment.\n\n - and here it ends indented.',
 
                     u'This is the new \'comment\'.\n\n - and here it ends indented.',
 
                     dict(
 
                        short_id='cafe1234',
 
                        raw_id='cafe1234c0ffeecafe',
 
                        branch='brunch',
 
                        cs_comment_user='Opinionated User (jsmith)',
 
                        cs_comment_url='http://comment.org',
 
                        is_mention=[False, True],
 
                        message='This changeset did something clever which is hard to explain',
 
                        message_short='This changeset did something cl...',
 
                        status_change=[None, 'Approved'],
 
                        cs_target_repo='http://example.com/repo_target',
 
                        cs_url='http://changeset.com',
 
                        cs_author=User.get(self.u2))),
 
                    (Notification.TYPE_MESSAGE,
 
                     u'This is the body of the test message\n - nothing interesting here except indentation.',
 
                     u'This is the \'body\' of the "test" message\n - nothing interesting here except indentation.',
 
                     dict()),
 
                    #(Notification.TYPE_MENTION, '$body', None), # not used
 
                    (Notification.TYPE_REGISTRATION,
 
                     u'Registration body',
 
                     dict(
 
                        new_username='newbie',
 
                        registered_user_url='http://newbie.org',
 
                        new_email='new@email.com',
 
                        new_full_name='New Full Name')),
 
                    (Notification.TYPE_PULL_REQUEST,
 
                     u'This PR is awesome because it does stuff\n - please approve indented!',
 
                     u'This PR is \'awesome\' because it does <stuff>\n - please approve indented!',
 
                     dict(
 
                        pr_user_created='Requesting User (root)', # pr_owner should perhaps be used for @mention in description ...
 
                        is_mention=[False, True],
 
                        pr_revisions=[('123abc'*7, "Introduce one and two\n\nand that's it"), ('567fed'*7, 'Make one plus two equal tree')],
 
                        org_repo_name='repo_org',
 
                        **pr_kwargs)),
 
                    (Notification.TYPE_PULL_REQUEST_COMMENT,
 
                     u'Me too!\n\n - and indented on second line',
 
                     dict(
 
                        closing_pr=[False, True],
 
                        is_mention=[False, True],
 
                        pr_comment_user='Opinionated User (jsmith)',
 
                        pr_comment_url='http://pr.org/comment',
 
                        status_change=[None, 'Under Review'],
 
                        **pr_kwargs)),
 
                    ]:
 
                    kwargs['repo_name'] = u'repo/name'
 
                    params = [(type_, type_, body, kwargs)]
 
                    for param_name in ['is_mention', 'status_change', 'closing_pr']: # TODO: inline/general
 
                        if not isinstance(kwargs.get(param_name), list):
 
                            continue
 
                        new_params = []
 
                        for v in kwargs[param_name]:
 
                            for desc, type_, body, kwargs in params:
 
                                kwargs = dict(kwargs)
 
                                kwargs[param_name] = v
 
                                new_params.append(('%s, %s=%r' % (desc, param_name, v), type_, body, kwargs))
 
                        params = new_params
 

	
 
                    for desc, type_, body, kwargs in params:
 
                        # desc is used as "global" variable
 
                        notification = NotificationModel().create(created_by=self.u1,
 
                                                           subject=u'unused', body=body, email_kwargs=kwargs,
 
                                                           recipients=[self.u2], type_=type_)
 

	
 
                # Email type TYPE_PASSWORD_RESET has no corresponding notification type - test it directly:
 
                desc = 'TYPE_PASSWORD_RESET'
 
                kwargs = dict(user='John Doe', reset_token='decbf64715098db5b0bd23eab44bd792670ab746', reset_url='http://reset.com/decbf64715098db5b0bd23eab44bd792670ab746')
 
                kallithea.lib.celerylib.tasks.send_email(['john@doe.com'],
 
                    "Password reset link",
 
                    EmailNotificationModel().get_email_tmpl(EmailNotificationModel.TYPE_PASSWORD_RESET, 'txt', **kwargs),
 
                    EmailNotificationModel().get_email_tmpl(EmailNotificationModel.TYPE_PASSWORD_RESET, 'html', **kwargs),
 
                    author=User.get(self.u1))
 

	
 
        out = '<!doctype html>\n<html lang="en">\n<head><title>Notifications</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>\n<body>\n%s\n</body>\n</html>\n' % \
 
            re.sub(r'<(/?(?:!doctype|html|head|title|meta|body)\b[^>]*)>', r'<!--\1-->', ''.join(l))
 

	
 
        outfn = os.path.join(os.path.dirname(__file__), 'test_dump_html_mails.out.html')
 
        reffn = os.path.join(os.path.dirname(__file__), 'test_dump_html_mails.ref.html')
 
        with open(outfn, 'w') as f:
 
            f.write(out)
 
        with open(reffn) as f:
 
            ref = f.read()
 
        assert ref == out # copy test_dump_html_mails.out.html to test_dump_html_mails.ref.html to update expectations
 
        os.unlink(outfn)
0 comments (0 inline, 0 general)