From d3090967c0d68341c8c5a7b3d5d16b8d3f35abb5 Mon Sep 17 00:00:00 2001 From: Nicola Iarocci Date: Wed, 24 May 2017 15:00:03 +0200 Subject: [PATCH] Fix broken (obsolete) test for #810 --- eve/methods/common.py | 2 -- eve/tests/endpoints.py | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eve/methods/common.py b/eve/methods/common.py index 4a40d9bf4..58aa60f68 100644 --- a/eve/methods/common.py +++ b/eve/methods/common.py @@ -1080,8 +1080,6 @@ def resource_link(): """ path = request.path.strip('/') - assert request.routing_exception is None, 'Routing error for %s: %s' % (request.url, request.routing_exception) - if '|item' in request.endpoint: path = path[:path.rfind('/')] diff --git a/eve/tests/endpoints.py b/eve/tests/endpoints.py index 74e71d377..46a8e0c0a 100644 --- a/eve/tests/endpoints.py +++ b/eve/tests/endpoints.py @@ -223,6 +223,7 @@ def test_api_prefix(self): self.assert201(r.status_code) def test_api_prefix_post_internal(self): + # https://github.com/pyeve/eve/issues/810 from eve.methods.post import post_internal settings_file = os.path.join(self.this_directory, 'test_prefix.py') @@ -230,13 +231,14 @@ def test_api_prefix_post_internal(self): self.test_prefix = self.app.test_client() # This works fine - with self.app.test_request_context(method='POST', path='/prefix/contacts'): - r, _, _, status_code = post_internal('contacts', {}) + with self.app.test_request_context( + method='POST', path='/prefix/contacts'): + _, _, _, status_code, _ = post_internal('contacts', {}) self.assert201(status_code) - # This fails + # This fails unless #810 is fixed with self.app.test_request_context(): - r, _, _, status_code = post_internal('contacts', {}) + _, _, _, status_code, _ = post_internal('contacts', {}) self.assert201(status_code) def test_api_prefix_version(self):