Skip to content

Commit

Permalink
Fix broken (obsolete) test for #810
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaiarocci committed May 24, 2017
1 parent 12ddf78 commit d309096
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions eve/methods/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('/')]

Expand Down
10 changes: 6 additions & 4 deletions eve/tests/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,20 +223,22 @@ 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')
self.app = Eve(settings=settings_file)
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):
Expand Down

0 comments on commit d309096

Please sign in to comment.