From c531b9d32b407da64d3acc570c06e85313bbb62b Mon Sep 17 00:00:00 2001 From: sasha-kantoriz Date: Sat, 19 Aug 2017 15:13:53 +0300 Subject: [PATCH] Fix request path trailing slash --- openregistry/api/tests/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openregistry/api/tests/base.py b/openregistry/api/tests/base.py index 90715ad..7bc63ff 100644 --- a/openregistry/api/tests/base.py +++ b/openregistry/api/tests/base.py @@ -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 @@ -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']