Undelete when relinking a deleted shot.
This commit is contained in:
@@ -393,6 +393,30 @@ class PatchShotTest(AbstractShotTest):
|
|||||||
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
|
||||||
|
def test_patch_relink_deleted(self):
|
||||||
|
"""Relinking a deleted shot should undelete it.
|
||||||
|
|
||||||
|
We implement PATCH by changing then PUTing, which undeletes.
|
||||||
|
"""
|
||||||
|
|
||||||
|
shot = self.create_shot()
|
||||||
|
self.create_valid_auth_token(ctd.EXAMPLE_PROJECT_OWNER_ID, 'token')
|
||||||
|
|
||||||
|
url = '/api/nodes/%s' % shot._id
|
||||||
|
|
||||||
|
# Delete (and verify deletion)
|
||||||
|
self.delete(url, auth_token='token',
|
||||||
|
headers={'If-Match': shot['_etag']},
|
||||||
|
expected_status=204)
|
||||||
|
self.get(url, auth_token='token', expected_status=404)
|
||||||
|
|
||||||
|
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):
|
class RequiredAfterCreationTest(AbstractShotTest):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user