[2/4] do not apply: disable validation of requests
diff mbox series

Message ID 20200128135523.29808-3-dja@axtens.net
State New
Headers show
Series
  • RFC for relations API
Related show

Commit Message

Daniel Axtens Jan. 28, 2020, 1:55 p.m. UTC
I am not skilled at API definition documents, and the validator
is strict. Work around it.

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

Patch
diff mbox series

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,