Editing the name of a shot/task/asset now logs the old and new name in the activity
This commit is contained in:
@@ -84,6 +84,35 @@ class TaskWorkflowTest(AbstractAttractTest):
|
||||
self.assertEqual(u'nööw name', found['name'])
|
||||
self.assertEqual(u'€ ≠ ¥', found['description'])
|
||||
|
||||
@responses.activate
|
||||
def test_edit_activity(self):
|
||||
"""Perform the edit, then check the resulting activity on the shot."""
|
||||
task = self.create_task()
|
||||
|
||||
# Only change the name -- the activity should contain both the old and the new name.
|
||||
old_name = task['name']
|
||||
new_name = u'nööw name'
|
||||
|
||||
with self.app.test_request_context():
|
||||
# Log in as project admin user
|
||||
pillar.auth.login_user(ctd.EXAMPLE_PROJECT_OWNER_ID)
|
||||
|
||||
self.mock_blenderid_validate_happy()
|
||||
self.mngr.edit_task(task._id,
|
||||
task_type=task['properties'].task_type,
|
||||
name=new_name,
|
||||
description=task.description,
|
||||
status=u'todo',
|
||||
_etag=task._etag)
|
||||
|
||||
with self.app.test_request_context():
|
||||
acts = self.app.pillar_extensions['attract'].activities_for_node(task['_id'])
|
||||
self.assertEqual(2, acts['_meta']['total']) # Creation + edit
|
||||
|
||||
edit_act = acts['_items'][1]
|
||||
self.assertIn(old_name, edit_act['verb'])
|
||||
self.assertIn(new_name, edit_act['verb'])
|
||||
|
||||
@responses.activate
|
||||
def test_load_save_task(self):
|
||||
"""Test for the Eve hooks -- we should be able to PUT what we GET."""
|
||||
|
Reference in New Issue
Block a user