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):