This repository has been archived by the owner on Mar 15, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for catching manifest viewer tracebacks - thanks, @robhudson!…
… (bug 784000)
- Loading branch information
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
import waffle | ||
from nose.tools import eq_, ok_ | ||
from pyquery import PyQuery as pq | ||
import requests | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
robhudson
Member
|
||
|
||
import amo | ||
import reviews | ||
|
@@ -965,6 +966,23 @@ def test_manifest_json_unicode(self, mock_get): | |
eq_(json.loads(r.content), {'content': u'كك some foreign ish', | ||
'headers': {}}) | ||
|
||
@mock.patch('mkt.reviewers.views.requests.get') | ||
def test_manifest_json_traceback_in_response(self, mock_get): | ||
m = mock.Mock() | ||
m.content = {'name': 'Some name'} | ||
m.headers = {} | ||
mock_get.side_effect = requests.exceptions.SSLError | ||
mock_get.return_value = m | ||
|
||
# We should not 500 on a traceback. | ||
|
||
r = self.client.get(reverse('reviewers.apps.review.manifest', | ||
args=[self.app.app_slug])) | ||
eq_(r.status_code, 200) | ||
data = json.loads(r.content) | ||
assert data['content'], 'There should be a content with the traceback' | ||
eq_(data['headers'], {}) | ||
|
||
def test_abuse(self): | ||
AbuseReport.objects.create(addon=self.app, message='!@#$') | ||
res = self.client.get(self.url) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alphabetical?