Merge lp:~cjohnston/ubuntu-ci-services-itself/more-ts-test-fixes into lp:ubuntu-ci-services-itself

Proposed by Chris Johnston
Status: Merged
Approved by: Chris Johnston
Approved revision: 79
Merged at revision: 81
Proposed branch: lp:~cjohnston/ubuntu-ci-services-itself/more-ts-test-fixes
Merge into: lp:ubuntu-ci-services-itself
Diff against target: 124 lines (+33/-14)
2 files modified
ticket_system/ticket/tests/test_full_read_api.py (+2/-2)
ticket_system/ticket/tests/test_read_api.py (+31/-12)
To merge this branch: bzr merge lp:~cjohnston/ubuntu-ci-services-itself/more-ts-test-fixes
Reviewer Review Type Date Requested Status
Ursula Junque (community) Approve
Review via email: mp+200582@code.launchpad.net

Commit message

Fixes tests that were failing but not noticed due to a typo.

Description of the change

Made a typo a while ago which caused some tests not to be run. Those tests were never updated because they "passed" as they weren't run. This removes that typo and fixes those tests that fail after the typo was fixed.

To post a comment you must log in.
Revision history for this message
Ursula Junque (ursinha) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ticket_system/ticket/tests/test_full_read_api.py'
2--- ticket_system/ticket/tests/test_full_read_api.py 2013-12-20 21:12:13 +0000
3+++ ticket_system/ticket/tests/test_full_read_api.py 2014-01-06 20:31:23 +0000
4@@ -17,10 +17,10 @@
5 from ci_utils.tastypie.test import TastypieTestCase
6
7
8-class TicketReadAPITest(TastypieTestCase):
9+class TicketFullReadAPITest(TastypieTestCase):
10
11 def setUp(self):
12- super(TicketReadAPITest, self).setUp('/api/v1')
13+ super(TicketFullReadAPITest, self).setUp('/api/v1')
14 self.ticket = mommy.make('Ticket')
15 self.sourcepackage = mommy.make('SourcePackage')
16 self.spu = mommy.make('SourcePackageUpload',
17
18=== modified file 'ticket_system/ticket/tests/test_read_api.py'
19--- ticket_system/ticket/tests/test_read_api.py 2013-12-20 21:12:13 +0000
20+++ ticket_system/ticket/tests/test_read_api.py 2014-01-06 20:31:23 +0000
21@@ -28,6 +28,7 @@
22 self.subticket = mommy.make('SubTicket', ticket=self.ticket,
23 source_package_upload=self.spu)
24 self.artifact = mommy.make('Artifact', subticket=self.subticket)
25+ self.maxDiff = None
26
27 def test_get_artifact_api(self):
28 obj = self.getResource('artifact/')
29@@ -49,17 +50,23 @@
30 u'resource_uri':
31 u'/api/v1/spu/{0}/'.format(self.spu.pk)},
32 u'ticket': {
33+ u'added_binaries': self.ticket.added_binaries,
34 u'status': self.ticket.status,
35+ u'created': unicode(self.ticket.created.strftime(
36+ "%Y-%m-%dT%H:%M:%S.%f")),
37 u'current_workflow_step':
38 self.ticket.current_workflow_step,
39 u'description': unicode(self.ticket.description),
40 u'title': unicode(self.ticket.title),
41 u'bug_id': self.ticket.bug_id,
42 u'owner': unicode(self.ticket.owner),
43+ u'removed_binaries': self.ticket.removed_binaries,
44 u'base_image': unicode(self.ticket.base_image),
45 u'id': self.ticket.pk,
46 u'resource_uri': u'/api/v1/ticket/{0}/'.format(
47- self.ticket.pk)},
48+ self.ticket.pk),
49+ u'updated': unicode(self.ticket.updated.strftime(
50+ "%Y-%m-%dT%H:%M:%S.%f"))},
51 u'id': self.subticket.pk,
52 u'resource_uri': u'/api/v1/subticket/{0}/'.format(
53 self.subticket.pk)},
54@@ -71,9 +78,11 @@
55 def test_get_subticket_api(self):
56 obj = self.getResource('subticket/')
57 self.assertEqual(obj['objects'][0], {
58- u'status': self.subticket.status,
59+ u'assignee': unicode(self.subticket.assignee),
60 u'current_workflow_step': self.subticket.current_workflow_step,
61- u'assignee': unicode(self.subticket.assignee),
62+ u'id': self.subticket.pk,
63+ u'resource_uri': u'/api/v1/subticket/{0}/'.format(
64+ self.subticket.pk),
65 u'source_package_upload': {
66 u'version': unicode(self.spu.version),
67 u'sourcepackage': {
68@@ -84,37 +93,47 @@
69 u'id': self.spu.pk,
70 u'resource_uri':
71 u'/api/v1/spu/{0}/'.format(self.spu.pk)},
72+ u'status': self.subticket.status,
73 u'ticket': {
74- u'status': self.ticket.status,
75+ u'added_binaries': self.ticket.added_binaries,
76+ u'base_image': unicode(self.ticket.base_image),
77+ u'bug_id': self.ticket.bug_id,
78+ u'created': unicode(self.ticket.created.strftime(
79+ "%Y-%m-%dT%H:%M:%S.%f")),
80 u'current_workflow_step':
81 self.ticket.current_workflow_step,
82 u'description': unicode(self.ticket.description),
83+ u'id': self.ticket.pk,
84+ u'owner': unicode(self.ticket.owner),
85+ u'removed_binaries': self.ticket.removed_binaries,
86+ u'status': self.ticket.status,
87 u'title': unicode(self.ticket.title),
88- u'bug_id': self.ticket.bug_id,
89- u'owner': unicode(self.ticket.owner),
90- u'base_image': unicode(self.ticket.base_image),
91- u'id': self.ticket.pk,
92 u'resource_uri': u'/api/v1/ticket/{0}/'.format(
93- self.ticket.pk)},
94- u'id': self.subticket.pk,
95- u'resource_uri': u'/api/v1/subticket/{0}/'.format(
96- self.subticket.pk),
97+ self.ticket.pk),
98+ u'updated': unicode(self.ticket.updated.strftime(
99+ "%Y-%m-%dT%H:%M:%S.%f"))},
100 })
101
102 def test_get_ticket_api(self):
103 obj = self.getResource('ticket/')
104 self.assertEqual(obj['objects'][0], {
105+ u'added_binaries': self.ticket.added_binaries,
106 u'status': self.ticket.status,
107+ u'created': unicode(self.ticket.created.strftime(
108+ "%Y-%m-%dT%H:%M:%S.%f")),
109 u'current_workflow_step':
110 self.ticket.current_workflow_step,
111 u'description': unicode(self.ticket.description),
112 u'title': unicode(self.ticket.title),
113 u'bug_id': self.ticket.bug_id,
114 u'owner': unicode(self.ticket.owner),
115+ u'removed_binaries': self.ticket.removed_binaries,
116 u'base_image': unicode(self.ticket.base_image),
117 u'id': self.ticket.pk,
118 u'resource_uri': u'/api/v1/ticket/{0}/'.format(
119 self.ticket.pk),
120+ u'updated': unicode(self.ticket.updated.strftime(
121+ "%Y-%m-%dT%H:%M:%S.%f")),
122 })
123
124 def test_get_sourcepackageupload_api(self):

Subscribers

People subscribed via source and target branches