Skip to content

Commit

Permalink
Fix request path trailing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha-kantoriz committed Aug 19, 2017
1 parent 3c356aa commit c531b9d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion openregistry/api/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ class BaseResourceWebTest(BaseWebTest):
@classmethod
def blank(cls, path, *args, **kwargs):
path = '/api/%s/%s%s' % (VERSION, cls.resource_name, path)
if path.endswith('/'):
path = path[:-1]
return webtest.app.TestRequest.blank(path, *args, **kwargs)

@classmethod
Expand Down Expand Up @@ -179,7 +181,7 @@ def create_resource(self, extra=None):
data = deepcopy(self.initial_data)
if extra:
data.update(extra)
response = self.app.post_json('', {'data': data})
response = self.app.post_json('/', {'data': data})
resource = response.json['data']
self.resource_token = response.json['access']['token']
self.resource_id = resource['id']
Expand Down

0 comments on commit c531b9d

Please sign in to comment.