Mercurial > p > roundup > code
comparison test/test_actions.py @ 6602:8269e89530e5
Test bad number path for ShowAction action.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 26 Jan 2022 20:46:42 -0500 |
| parents | 37b57da3374f |
| children | 9ca5cbffa0c4 |
comparison
equal
deleted
inserted
replaced
| 6601:154f286061e2 | 6602:8269e89530e5 |
|---|---|
| 79 action = ShowAction(self.client) | 79 action = ShowAction(self.client) |
| 80 self.assertRaises(ValueError, action.handle) | 80 self.assertRaises(ValueError, action.handle) |
| 81 self.form.value.append(MiniFieldStorage('@number', '1')) | 81 self.form.value.append(MiniFieldStorage('@number', '1')) |
| 82 self.assertRaisesMessage(ValueError, action.handle, | 82 self.assertRaisesMessage(ValueError, action.handle, |
| 83 'No type specified') | 83 'No type specified') |
| 84 | |
| 85 def testShowActionBadNumber(self): | |
| 86 action = ShowAction(self.client) | |
| 87 self.assertRaises(ValueError, action.handle) | |
| 88 self.form.value.append(MiniFieldStorage('@number', 'A')) | |
| 89 self.form.value.append(MiniFieldStorage('@type', 'issue')) | |
| 90 with self.assertRaises(SeriousError) as ctx: | |
| 91 action.handle() | |
| 92 self.assertEqual('"A" is not an ID (issue ID required)', | |
| 93 ctx.exception.args[0]) | |
| 84 | 94 |
| 85 class RetireActionTestCase(ActionTestCase): | 95 class RetireActionTestCase(ActionTestCase): |
| 86 def testRetireAction(self): | 96 def testRetireAction(self): |
| 87 self.client.db.security.hasPermission = true | 97 self.client.db.security.hasPermission = true |
| 88 self.client._ok_message = [] | 98 self.client._ok_message = [] |
