[PATCH 2/4] do not apply: disable validation of requests

Daniel Axtens dja at axtens.net
Wed Jan 29 00:55:21 AEDT 2020


I am not skilled at API definition documents, and the validator
is strict. Work around it.

Signed-off-by: Daniel Axtens <dja at axtens.net>
---
 patchwork/tests/api/utils.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/patchwork/tests/api/utils.py b/patchwork/tests/api/utils.py
index c405f737bf63..60d80becf019 100644
--- a/patchwork/tests/api/utils.py
+++ b/patchwork/tests/api/utils.py
@@ -112,8 +112,8 @@ class APIClient(BaseAPIClient):
         self.factory = APIRequestFactory()
 
     def get(self, path, data=None, follow=False, **extra):
-        validate_request = extra.pop('validate_request', True)
-        validate_response = extra.pop('validate_response', True)
+        validate_request = extra.pop('validate_request', False)
+        validate_response = extra.pop('validate_response', False)
 
         request = self.factory.get(
             path, data=data, SERVER_NAME='example.com', **extra)
@@ -127,8 +127,8 @@ class APIClient(BaseAPIClient):
 
     def post(self, path, data=None, format=None, content_type=None,
              follow=False, **extra):
-        validate_request = extra.pop('validate_request', True)
-        validate_response = extra.pop('validate_response', True)
+        validate_request = extra.pop('validate_request', False)
+        validate_response = extra.pop('validate_response', False)
 
         request = self.factory.post(
             path, data=data, format='json', content_type=content_type,
@@ -144,8 +144,8 @@ class APIClient(BaseAPIClient):
 
     def put(self, path, data=None, format=None, content_type=None,
             follow=False, **extra):
-        validate_request = extra.pop('validate_request', True)
-        validate_response = extra.pop('validate_response', True)
+        validate_request = extra.pop('validate_request', False)
+        validate_response = extra.pop('validate_response', False)
 
         request = self.factory.put(
             path, data=data, format='json', content_type=content_type,
@@ -161,8 +161,8 @@ class APIClient(BaseAPIClient):
 
     def patch(self, path, data=None, format=None, content_type=None,
               follow=False, **extra):
-        validate_request = extra.pop('validate_request', True)
-        validate_response = extra.pop('validate_response', True)
+        validate_request = extra.pop('validate_request', False)
+        validate_response = extra.pop('validate_response', False)
 
         request = self.factory.patch(
             path, data=data, format='json', content_type=content_type,
-- 
2.20.1



More information about the Patchwork mailing list