Allow Blender to mark shots as used/not used in edit.

NOTE: requires schema change, so be careful.
This commit is contained in:
2016-11-03 18:08:51 +01:00
parent dad5e4ceac
commit c40fdb378c
3 changed files with 65 additions and 9 deletions

View File

@@ -339,6 +339,38 @@ class PatchShotTest(AbstractShotTest):
}
self.patch(url, json=patch, auth_token='other', expected_status=403)
@responses.activate
def test_patch_unlink(self):
shot = self.create_shot()
self.create_valid_auth_token(ctd.EXAMPLE_PROJECT_OWNER_ID, 'token')
url = '/api/nodes/%s' % shot._id
dbnode = self.get(url, auth_token='token').json()
self.assertNotIn('used_in_edit', dbnode['properties'])
patch = {'op': 'unlink'}
self.patch(url, json=patch, auth_token='token')
dbnode = self.get(url, auth_token='token').json()
self.assertFalse(dbnode['properties']['used_in_edit'])
@responses.activate
def test_patch_relink(self):
shot = self.create_shot()
self.create_valid_auth_token(ctd.EXAMPLE_PROJECT_OWNER_ID, 'token')
url = '/api/nodes/%s' % shot._id
dbnode = self.get(url, auth_token='token').json()
self.assertNotIn('used_in_edit', dbnode['properties'])
patch = {'op': 'relink'}
self.patch(url, json=patch, auth_token='token')
dbnode = self.get(url, auth_token='token').json()
self.assertTrue(dbnode['properties']['used_in_edit'])
class RequiredAfterCreationTest(AbstractShotTest):
"""