diff --git a/tests/test_db.py b/tests/test_db.py index ad5d68252..31e57a922 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -58,6 +58,7 @@ def get_tasks(tw): config = ConfigParser.RawConfigParser() config.add_section('general') config.set('general', 'targets', 'my_service') + config.set('general', 'static_fields', 'project, priority') config.add_section('my_service') config.set('my_service', 'service', 'github') @@ -66,6 +67,7 @@ def get_tasks(tw): issue = { 'description': 'Blah blah blah. ☃', + 'project': 'sample_project', 'githubtype': 'issue', 'githuburl': 'https://example.com', 'priority': 'M', @@ -78,30 +80,35 @@ def get_tasks(tw): self.assertEqual(get_tasks(tw), { 'completed': [], 'pending': [{ + u'project': u'sample_project', u'priority': u'M', u'status': u'pending', u'description': u'Blah blah blah. ☃', u'githuburl': u'https://example.com', u'githubtype': u'issue', u'id': 1, - u'urgency': 3.9, + u'urgency': 4.9, }]}) # TEST CHANGED ISSUE. issue['description'] = 'Yada yada yada.' + # Change static field + issue['project'] = 'other_project' + db.synchronize(iter((issue,)), config, 'general') self.assertEqual(get_tasks(tw), { 'completed': [], 'pending': [{ u'priority': u'M', + u'project': u'sample_project', u'status': u'pending', u'description': u'Yada yada yada.', u'githuburl': u'https://example.com', u'githubtype': u'issue', u'id': 1, - u'urgency': 3.9, + u'urgency': 4.9, }]}) # TEST CLOSED ISSUE. @@ -117,13 +124,14 @@ def get_tasks(tw): self.assertEqual(tasks, { 'completed': [{ + u'project': u'sample_project', u'description': u'Yada yada yada.', u'githubtype': u'issue', u'githuburl': u'https://example.com', u'id': 0, u'priority': u'M', u'status': u'completed', - u'urgency': 3.9, + u'urgency': 4.9, }], 'pending': []})