Added etag checking when saving tasks & shots. Still a bit rough.

Needs nicer user interface stuff for explaining what's going on.
This commit is contained in:
2016-09-22 18:28:11 +02:00
parent d13abb5b34
commit 498e1d5ecc
7 changed files with 47 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import responses
from bson import ObjectId
import pillarsdk
import pillarsdk.exceptions as sdk_exceptions
import pillar.api.utils
import pillar.tests
import pillar.auth
@@ -59,11 +60,20 @@ class TaskWorkflowTest(AbstractAttractTest):
pillar.auth.login_user(ctd.EXAMPLE_PROJECT_OWNER_ID)
self.mock_blenderid_validate_happy()
self.assertRaises(sdk_exceptions.PreconditionFailed,
self.mngr.edit_task,
task._id,
task_type=u'je møder',
name=u'nööw name',
description=u'€ ≠ ¥',
status='todo',
_etag='jemoeder')
self.mngr.edit_task(task._id,
task_type=u'je møder',
name=u'nööw name',
description=u'€ ≠ ¥',
status='todo')
status='todo',
_etag=task._etag)
# Test directly with MongoDB
with self.app.test_request_context():