diff --git a/mediagoblin/tests/test_response.py b/mediagoblin/tests/test_response.py
new file mode 100644
index 0000000..13b4895
|
-
|
+
|
|
| | 1 | import mock |
| | 2 | from werkzeug.wrappers import Request |
| | 3 | |
| | 4 | from mediagoblin.tools.response import redirect |
| | 5 | |
| | 6 | @mock.patch('werkzeug.utils.redirect') |
| | 7 | def test_redirect_with_location_uses_location(werkzeug_redirect): |
| | 8 | """Test that redirect repects the location argument.""" |
| | 9 | |
| | 10 | # The fact that we're having to mock werkzeug.utils.redirect suggest that it |
| | 11 | # may help to refactor tools.redirect to make it easier to test. |
| | 12 | request = Request({}) |
| | 13 | redirect(request, location='http://www.example.com') |
| | 14 | werkzeug_redirect.assert_called_with('http://www.example.com') |