Python 3.6 compatibility: Applied 2to3

This commit is contained in:
2017-03-03 15:08:48 +01:00
parent cd17236428
commit 4e8c735f6b
14 changed files with 131 additions and 140 deletions

View File

@@ -34,7 +34,7 @@ class TaskWorkflowTest(AbstractAttractTest):
@responses.activate
def test_create_task(self):
task = self.create_task(task_type=u'Just düüüh it')
task = self.create_task(task_type='Just düüüh it')
self.assertIsNotNone(task)
# Test directly with MongoDB
@@ -42,12 +42,12 @@ class TaskWorkflowTest(AbstractAttractTest):
nodes_coll = self.app.data.driver.db['nodes']
found = nodes_coll.find_one(ObjectId(task['_id']))
self.assertIsNotNone(found)
self.assertEqual(u'Just düüüh it', found['properties']['task_type'])
self.assertEqual('Just düüüh it', found['properties']['task_type'])
# Test it through the API
resp = self.get('/api/nodes/%s' % task['_id'])
found = resp.json()
self.assertEqual(u'Just düüüh it', found['properties']['task_type'])
self.assertEqual('Just düüüh it', found['properties']['task_type'])
@responses.activate
def test_edit_task(self):
@@ -61,15 +61,15 @@ class TaskWorkflowTest(AbstractAttractTest):
self.assertRaises(sdk_exceptions.PreconditionFailed,
self.mngr.edit_task,
task._id,
task_type=u'je møder',
name=u'nööw name',
description=u'€ ≠ ¥',
task_type='je møder',
name='nööw name',
description='€ ≠ ¥',
status='todo',
_etag='jemoeder')
self.mngr.edit_task(task._id,
task_type=u'je møder',
name=u'nööw name',
description=u'€ ≠ ¥',
task_type='je møder',
name='nööw name',
description='€ ≠ ¥',
status='todo',
_etag=task._etag)
@@ -77,10 +77,10 @@ class TaskWorkflowTest(AbstractAttractTest):
with self.app.test_request_context():
nodes_coll = self.app.data.driver.db['nodes']
found = nodes_coll.find_one(ObjectId(task['_id']))
self.assertEqual(u'je møder', found['properties']['task_type'])
self.assertEqual(u'todo', found['properties']['status'])
self.assertEqual(u'nööw name', found['name'])
self.assertEqual(u'€ ≠ ¥', found['description'])
self.assertEqual('je møder', found['properties']['task_type'])
self.assertEqual('todo', found['properties']['status'])
self.assertEqual('nööw name', found['name'])
self.assertEqual('€ ≠ ¥', found['description'])
@responses.activate
def test_edit_activity(self):
@@ -89,7 +89,7 @@ class TaskWorkflowTest(AbstractAttractTest):
# 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'
new_name = 'nööw name'
with self.app.test_request_context():
# Log in as project admin user
@@ -100,7 +100,7 @@ class TaskWorkflowTest(AbstractAttractTest):
task_type=task['properties'].task_type,
name=new_name,
description=task.description,
status=u'todo',
status='todo',
_etag=task._etag)
with self.app.test_request_context():
@@ -115,8 +115,8 @@ class TaskWorkflowTest(AbstractAttractTest):
def test_load_save_task(self):
"""Test for the Eve hooks -- we should be able to PUT what we GET."""
task_parent = self.create_task(task_type=u'Just düüüh it')
task_child = self.create_task(task_type=u'mamaaaah',
task_parent = self.create_task(task_type='Just düüüh it')
task_child = self.create_task(task_type='mamaaaah',
parent=task_parent['_id'])
self.create_valid_auth_token(ctd.EXAMPLE_PROJECT_OWNER_ID, 'token')