Ensure used_in_edit is always set on new shots.

This commit is contained in:
2016-11-04 16:31:03 +01:00
parent 6f7090eedc
commit 5ee3c0d54f
2 changed files with 16 additions and 4 deletions

View File

@@ -347,7 +347,7 @@ class PatchShotTest(AbstractShotTest):
url = '/api/nodes/%s' % shot._id
dbnode = self.get(url, auth_token='token').json()
self.assertNotIn('used_in_edit', dbnode['properties'])
self.assertTrue(dbnode['properties']['used_in_edit'])
patch = {'op': 'unlink'}
self.patch(url, json=patch, auth_token='token')
@@ -383,12 +383,12 @@ class PatchShotTest(AbstractShotTest):
self.create_valid_auth_token(ctd.EXAMPLE_PROJECT_OWNER_ID, 'token')
url = '/api/nodes/%s' % shot._id
self.patch(url, json={'op': 'unlink'}, auth_token='token')
dbnode = self.get(url, auth_token='token').json()
self.assertNotIn('used_in_edit', dbnode['properties'])
self.assertFalse(dbnode['properties']['used_in_edit'])
patch = {'op': 'relink'}
self.patch(url, json=patch, auth_token='token')
self.patch(url, json={'op': 'relink'}, auth_token='token')
dbnode = self.get(url, auth_token='token').json()
self.assertTrue(dbnode['properties']['used_in_edit'])