allura
Révision | c9be7efe0a04af08d06636a593f73adbe6ad5935 (tree) |
---|---|
l'heure | 2012-07-11 11:18:25 |
Auteur | Dave Brondsema <dbrondsema@geek...> |
Commiter | Dave Brondsema |
[#4272] fix api tests to use proper HTTP verb
@@ -60,7 +60,7 @@ class TestRestUpdateTicket(TestTrackerApiBase): | ||
60 | 60 | self.ticket_args = ticket_view.json['ticket'] |
61 | 61 | |
62 | 62 | def test_ticket_index(self): |
63 | - tickets = self.api_post('/rest/p/test/bugs/') | |
63 | + tickets = self.api_get('/rest/p/test/bugs/') | |
64 | 64 | assert len(tickets.json['tickets']) == 1, tickets.json |
65 | 65 | assert (tickets.json['tickets'][0] |
66 | 66 | == dict(ticket_num=1, summary='test new ticket')), tickets.json['tickets'][0] |
@@ -94,22 +94,22 @@ class TestRestDiscussion(TestTrackerApiBase): | ||
94 | 94 | self.ticket_args = ticket_view.json['ticket'] |
95 | 95 | |
96 | 96 | def test_index(self): |
97 | - r = self.api_post('/rest/p/test/bugs/_discuss/') | |
97 | + r = self.api_get('/rest/p/test/bugs/_discuss/') | |
98 | 98 | assert len(r.json['discussion']['threads']) == 1, r.json |
99 | 99 | for t in r.json['discussion']['threads']: |
100 | - r = self.api_post('/rest/p/test/bugs/_discuss/thread/%s/' % t['_id']) | |
100 | + r = self.api_get('/rest/p/test/bugs/_discuss/thread/%s/' % t['_id']) | |
101 | 101 | assert len(r.json['thread']['posts']) == 0, r.json |
102 | 102 | |
103 | 103 | def test_post(self): |
104 | - discussion = self.api_post('/rest/p/test/bugs/_discuss/').json['discussion'] | |
104 | + discussion = self.api_get('/rest/p/test/bugs/_discuss/').json['discussion'] | |
105 | 105 | post = self.api_post('/rest/p/test/bugs/_discuss/thread/%s/new' % discussion['threads'][0]['_id'], |
106 | 106 | text='This is a comment', wrap_args=None) |
107 | - thread = self.api_post('/rest/p/test/bugs/_discuss/thread/%s/' % discussion['threads'][0]['_id']) | |
107 | + thread = self.api_get('/rest/p/test/bugs/_discuss/thread/%s/' % discussion['threads'][0]['_id']) | |
108 | 108 | assert len(thread.json['thread']['posts']) == 1, thread.json |
109 | 109 | assert post.json['post']['text'] == 'This is a comment', post.json |
110 | 110 | reply = self.api_post( |
111 | 111 | '/rest/p/test/bugs/_discuss/thread/%s/%s/reply' % (thread.json['thread']['_id'], post.json['post']['slug']), |
112 | 112 | text='This is a reply', wrap_args=None) |
113 | 113 | assert reply.json['post']['text'] == 'This is a reply', reply.json |
114 | - thread = self.api_post('/rest/p/test/bugs/_discuss/thread/%s/' % discussion['threads'][0]['_id']) | |
114 | + thread = self.api_get('/rest/p/test/bugs/_discuss/thread/%s/' % discussion['threads'][0]['_id']) | |
115 | 115 | assert len(thread.json['thread']['posts']) == 2, thread.json |