Flask's RequestWrapper changed the json() function to a json property

This commit is contained in:
2018-08-29 14:00:57 +02:00
parent bbf21f614d
commit 3dd3006452
3 changed files with 13 additions and 13 deletions

View File

@@ -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)

View File

@@ -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'])

View File

@@ -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),