Flask's RequestWrapper changed the json()
function to a json
property
This commit is contained in:
@@ -27,7 +27,7 @@ class TaskWorkflowTest(AbstractAttractTest):
|
|||||||
|
|
||||||
url = '/api/projects/%s' % self.project_id
|
url = '/api/projects/%s' % self.project_id
|
||||||
resp = self.get(url)
|
resp = self.get(url)
|
||||||
proj = resp.json()
|
proj = resp.json
|
||||||
|
|
||||||
put_proj = pillar.api.utils.remove_private_keys(proj)
|
put_proj = pillar.api.utils.remove_private_keys(proj)
|
||||||
|
|
||||||
|
@@ -165,7 +165,7 @@ class PatchShotTest(AbstractShotTest):
|
|||||||
}
|
}
|
||||||
self.patch(url, json=patch, auth_token='token')
|
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('"shot" is "geschoten" in Dutch', dbnode['name'])
|
||||||
self.assertEqual(123, dbnode['properties']['trim_start_in_frames'])
|
self.assertEqual(123, dbnode['properties']['trim_start_in_frames'])
|
||||||
self.assertEqual(0, dbnode['properties']['trim_end_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')
|
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('Таким образом, этот человек заходит в бар, и говорит…',
|
self.assertEqual('Таким образом, этот человек заходит в бар, и говорит…',
|
||||||
dbnode['description'])
|
dbnode['description'])
|
||||||
self.assertEqual('Два бокала вашей лучшей водки, пожалуйста.',
|
self.assertEqual('Два бокала вашей лучшей водки, пожалуйста.',
|
||||||
@@ -239,7 +239,7 @@ class PatchShotTest(AbstractShotTest):
|
|||||||
}
|
}
|
||||||
self.patch(url, json=patch, auth_token='token')
|
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('description', dbnode)
|
||||||
self.assertNotIn('notes', dbnode['properties'])
|
self.assertNotIn('notes', dbnode['properties'])
|
||||||
self.assertEqual('final', dbnode['properties']['status'])
|
self.assertEqual('final', dbnode['properties']['status'])
|
||||||
@@ -318,13 +318,13 @@ class PatchShotTest(AbstractShotTest):
|
|||||||
|
|
||||||
url = '/api/nodes/%s' % shot._id
|
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'])
|
self.assertTrue(dbnode['properties']['used_in_edit'])
|
||||||
|
|
||||||
patch = {'op': 'unlink'}
|
patch = {'op': 'unlink'}
|
||||||
self.patch(url, json=patch, auth_token='token')
|
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'])
|
self.assertFalse(dbnode['properties']['used_in_edit'])
|
||||||
|
|
||||||
@responses.activate
|
@responses.activate
|
||||||
@@ -357,12 +357,12 @@ class PatchShotTest(AbstractShotTest):
|
|||||||
url = '/api/nodes/%s' % shot._id
|
url = '/api/nodes/%s' % shot._id
|
||||||
self.patch(url, json={'op': 'unlink'}, auth_token='token')
|
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.assertFalse(dbnode['properties']['used_in_edit'])
|
||||||
|
|
||||||
self.patch(url, json={'op': 'relink'}, auth_token='token')
|
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'])
|
self.assertTrue(dbnode['properties']['used_in_edit'])
|
||||||
|
|
||||||
@responses.activate
|
@responses.activate
|
||||||
@@ -386,7 +386,7 @@ class PatchShotTest(AbstractShotTest):
|
|||||||
patch = {'op': 'relink'}
|
patch = {'op': 'relink'}
|
||||||
self.patch(url, json=patch, auth_token='token')
|
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'])
|
self.assertTrue(dbnode['properties']['used_in_edit'])
|
||||||
|
|
||||||
|
|
||||||
@@ -420,10 +420,10 @@ class RequiredAfterCreationTest(AbstractShotTest):
|
|||||||
|
|
||||||
resp = self.post('/api/nodes', json=shot,
|
resp = self.post('/api/nodes', json=shot,
|
||||||
auth_token='token', expected_status=201)
|
auth_token='token', expected_status=201)
|
||||||
info = resp.json()
|
info = resp.json
|
||||||
|
|
||||||
resp = self.get('/api/nodes/%(_id)s' % info, auth_token='token')
|
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'],
|
self.assertEqual(node_type_shot['dyn_schema']['status']['default'],
|
||||||
json_shot['properties']['status'])
|
json_shot['properties']['status'])
|
||||||
|
@@ -50,7 +50,7 @@ class TaskWorkflowTest(AbstractAttractTest):
|
|||||||
|
|
||||||
# Test it through the API
|
# Test it through the API
|
||||||
resp = self.get('/api/nodes/%s' % task['_id'])
|
resp = self.get('/api/nodes/%s' % task['_id'])
|
||||||
found = resp.json()
|
found = resp.json
|
||||||
self.assertEqual('Just düüüh it', found['properties']['task_type'])
|
self.assertEqual('Just düüüh it', found['properties']['task_type'])
|
||||||
|
|
||||||
@responses.activate
|
@responses.activate
|
||||||
@@ -127,7 +127,7 @@ class TaskWorkflowTest(AbstractAttractTest):
|
|||||||
|
|
||||||
url = '/api/nodes/%s' % task_child['_id']
|
url = '/api/nodes/%s' % task_child['_id']
|
||||||
resp = self.get(url)
|
resp = self.get(url)
|
||||||
json_task = resp.json()
|
json_task = resp.json
|
||||||
|
|
||||||
self.put(url,
|
self.put(url,
|
||||||
json=remove_private_keys(json_task),
|
json=remove_private_keys(json_task),
|
||||||
|
Reference in New Issue
Block a user