Skip to content

Commit

Permalink
Issue #3121 - Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Taylor committed Jan 3, 2020
1 parent 524e130 commit d02173d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/unit/test_urls.py
Expand Up @@ -57,7 +57,7 @@ def test_new_issue(self):

@patch('webcompat.views.report_issue')
def test_successful_post_new_issue(self, mock_proxy):
"""Test that post is working on /issues/new."""
"""Test that anonymous post is not working on /issues/new."""
mock_proxy.return_value = POST_RESPONSE
rv = self.app.post(
'/issues/new',
Expand All @@ -71,11 +71,12 @@ def test_successful_post_new_issue(self, mock_proxy):
submit_type='github-proxy-report',
url='http://testing.example.org',
username='yeeha'))
self.assertEqual(rv.status_code, 302)
self.assertEqual(
rv.headers['Location'], 'http://localhost/issues/1544')
self.assertTrue(
b'<a href="/issues/1544">/issues/1544</a>' in rv.data)
self.assertEqual(rv.status_code, 400)
# Commented out while anonymous reporting is disabled
# self.assertNotEqual(
# rv.headers['Location'], 'http://localhost/issues/1544')
# self.assertTrue(
# b'<a href="/issues/1544">/issues/1544</a>' in rv.data)

@patch('webcompat.issues.proxy_request')
def test_fail_post_new_issue(self, mock_proxy):
Expand Down

0 comments on commit d02173d

Please sign in to comment.