From 3dd300645276767c3b2fa157cee73da9f1d1fa57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 29 Aug 2018 14:00:57 +0200 Subject: [PATCH] Flask's RequestWrapper changed the `json()` function to a `json` property --- tests/test_setup_for_attract.py | 2 +- tests/test_shots.py | 20 ++++++++++---------- tests/test_tasks.py | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/test_setup_for_attract.py b/tests/test_setup_for_attract.py index 6fafe92..5421f67 100644 --- a/tests/test_setup_for_attract.py +++ b/tests/test_setup_for_attract.py @@ -27,7 +27,7 @@ class TaskWorkflowTest(AbstractAttractTest): url = '/api/projects/%s' % self.project_id resp = self.get(url) - proj = resp.json() + proj = resp.json put_proj = pillar.api.utils.remove_private_keys(proj) diff --git a/tests/test_shots.py b/tests/test_shots.py index 03f7324..22009b4 100644 --- a/tests/test_shots.py +++ b/tests/test_shots.py @@ -165,7 +165,7 @@ class PatchShotTest(AbstractShotTest): } self.patch(url, json=patch, auth_token='token') - dbnode = self.get(url, auth_token='token').json() + dbnode = self.get(url, auth_token='token').json self.assertEqual('"shot" is "geschoten" in Dutch', dbnode['name']) self.assertEqual(123, dbnode['properties']['trim_start_in_frames']) self.assertEqual(0, dbnode['properties']['trim_end_in_frames']) @@ -215,7 +215,7 @@ class PatchShotTest(AbstractShotTest): } self.patch(url, json=patch, auth_token='token') - dbnode = self.get(url, auth_token='token').json() + dbnode = self.get(url, auth_token='token').json self.assertEqual('Таким образом, этот человек заходит в бар, и говорит…', dbnode['description']) self.assertEqual('Два бокала вашей лучшей водки, пожалуйста.', @@ -239,7 +239,7 @@ class PatchShotTest(AbstractShotTest): } self.patch(url, json=patch, auth_token='token') - dbnode = self.get(url, auth_token='token').json() + dbnode = self.get(url, auth_token='token').json self.assertNotIn('description', dbnode) self.assertNotIn('notes', dbnode['properties']) self.assertEqual('final', dbnode['properties']['status']) @@ -318,13 +318,13 @@ class PatchShotTest(AbstractShotTest): url = '/api/nodes/%s' % shot._id - dbnode = self.get(url, auth_token='token').json() + dbnode = self.get(url, auth_token='token').json self.assertTrue(dbnode['properties']['used_in_edit']) patch = {'op': 'unlink'} self.patch(url, json=patch, auth_token='token') - dbnode = self.get(url, auth_token='token').json() + dbnode = self.get(url, auth_token='token').json self.assertFalse(dbnode['properties']['used_in_edit']) @responses.activate @@ -357,12 +357,12 @@ class PatchShotTest(AbstractShotTest): url = '/api/nodes/%s' % shot._id self.patch(url, json={'op': 'unlink'}, auth_token='token') - dbnode = self.get(url, auth_token='token').json() + dbnode = self.get(url, auth_token='token').json self.assertFalse(dbnode['properties']['used_in_edit']) self.patch(url, json={'op': 'relink'}, auth_token='token') - dbnode = self.get(url, auth_token='token').json() + dbnode = self.get(url, auth_token='token').json self.assertTrue(dbnode['properties']['used_in_edit']) @responses.activate @@ -386,7 +386,7 @@ class PatchShotTest(AbstractShotTest): patch = {'op': 'relink'} self.patch(url, json=patch, auth_token='token') - dbnode = self.get(url, auth_token='token').json() + dbnode = self.get(url, auth_token='token').json self.assertTrue(dbnode['properties']['used_in_edit']) @@ -420,10 +420,10 @@ class RequiredAfterCreationTest(AbstractShotTest): resp = self.post('/api/nodes', json=shot, auth_token='token', expected_status=201) - info = resp.json() + info = resp.json resp = self.get('/api/nodes/%(_id)s' % info, auth_token='token') - json_shot = resp.json() + json_shot = resp.json self.assertEqual(node_type_shot['dyn_schema']['status']['default'], json_shot['properties']['status']) diff --git a/tests/test_tasks.py b/tests/test_tasks.py index 6deb97d..96beb62 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -50,7 +50,7 @@ class TaskWorkflowTest(AbstractAttractTest): # Test it through the API resp = self.get('/api/nodes/%s' % task['_id']) - found = resp.json() + found = resp.json self.assertEqual('Just düüüh it', found['properties']['task_type']) @responses.activate @@ -127,7 +127,7 @@ class TaskWorkflowTest(AbstractAttractTest): url = '/api/nodes/%s' % task_child['_id'] resp = self.get(url) - json_task = resp.json() + json_task = resp.json self.put(url, json=remove_private_keys(json_task),