Skip to content

Commit 22f76f8

Browse files
committed
Issue #3150 - Tests for report_public_issue
1 parent e1b2a62 commit 22f76f8

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

tests/unit/test_issues.py

+11
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@
99

1010
import unittest
1111
import requests
12+
import json
1213

1314
from mock import patch
15+
from mock import ANY
1416
from werkzeug import MultiDict
1517

1618
from webcompat.issues import report_issue
1719
from webcompat.issues import report_private_issue
20+
from webcompat.issues import report_public_issue
21+
from webcompat.issues import moderation_template
1822

1923

2024
class TestIssue(unittest.TestCase):
@@ -60,3 +64,10 @@ def test_report_private_issue_returns_nothing(self, mockpost):
6064
('username', ''), ])
6165
rv = report_private_issue(form, 'http://public.example.com')
6266
self.assertIsNone(rv)
67+
68+
@patch.object(requests, 'post')
69+
def test_report_public_issue_returns_moderation_template(self, mockpost):
70+
"""Test that we get a moderation template back from a public issue report.""" # noqa
71+
report_public_issue()
72+
data = json.dumps(moderation_template())
73+
mockpost.assert_called_with(ANY, data=data, headers=ANY, params=ANY)

webcompat/issues.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ def moderation_template():
2828

2929
summary = """In the moderation queue."""
3030
body = """<p>This issue has been put in the moderation queue. A human
31-
will review if the message meets our current
32-
<a href="https://www.mozilla.org/en-US/about/legal/acceptable-use/">acceptable use</a> guidelines.
31+
will review if the message meets our current
32+
<a href="https://www.mozilla.org/en-US/about/legal/acceptable-use/">
33+
acceptable use</a> guidelines.
3334
It will probably take a couple of days depending on the backlog.
3435
Once it has been reviewed, the content will be either made public
3536
or deleted.</p>"""

webcompat/static/css/src/issue.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
}
126126

127127
.issue-details {
128-
word-break: break-all;
128+
word-break: break-word;
129129
}
130130

131131
.issue-details-nsfw {

0 commit comments

Comments
 (0)