Mercurial > p > roundup > code
diff test/test_rest.py @ 5599:a76d88673375 REST-rebased
Added Patch operator 'action'
.. to perform actions such as 'retire'
committer: Ralf Schlatterbeck <rsc@runtux.com>
| author | Chau Nguyen <dangchau1991@yahoo.com> |
|---|---|
| date | Wed, 30 Jan 2019 10:26:35 +0100 |
| parents | 65caddd54da2 |
| children | e2c74d8121f3 |
line wrap: on
line diff
--- a/test/test_rest.py Wed Jan 30 10:26:35 2019 +0100 +++ b/test/test_rest.py Wed Jan 30 10:26:35 2019 +0100 @@ -461,6 +461,25 @@ self.assertEqual(len(results['attributes']['nosy']), 0) self.assertEqual(results['attributes']['nosy'], []) + def testPatchAction(self): + """ + Test Patch Action 'Action' + """ + # create a new issue with userid 1 and 2 in the nosy list + issue_id = self.db.issue.create(title='foo') + + # execute action retire + form = cgi.FieldStorage() + form.list = [ + cgi.MiniFieldStorage('op', 'action'), + cgi.MiniFieldStorage('action_name', 'retire') + ] + results = self.server.patch_element('issue', issue_id, form) + self.assertEqual(self.dummy_client.response_code, 200) + + # verify the result + self.assertTrue(self.db.issue.is_retired(issue_id)) + def testPatchRemove(self): """ Test Patch Action 'Remove' only some element from a list
