Mercurial > p > roundup > code
comparison test/test_cgi.py @ 5794:95a366d46065
Replace deprecated assertEquals with assertEqual and failUnlessRaises
with assertRaises.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 10 Jun 2019 21:27:17 -0400 |
| parents | 68b0c1767b50 |
| children | 39a5f40ae4d4 |
comparison
equal
deleted
inserted
replaced
| 5793:6aad7b194e63 | 5794:95a366d46065 |
|---|---|
| 1215 def data_set(self, key, **value): | 1215 def data_set(self, key, **value): |
| 1216 self.db.Otk.data[key] = value | 1216 self.db.Otk.data[key] = value |
| 1217 | 1217 |
| 1218 def testClassPermission(self): | 1218 def testClassPermission(self): |
| 1219 cl = self._make_client(dict(username='bob')) | 1219 cl = self._make_client(dict(username='bob')) |
| 1220 self.failUnlessRaises(exceptions.Unauthorised, | 1220 self.assertRaises(exceptions.Unauthorised, |
| 1221 actions.EditItemAction(cl).handle) | 1221 actions.EditItemAction(cl).handle) |
| 1222 cl.nodeid = '1' | 1222 cl.nodeid = '1' |
| 1223 self.assertRaises(exceptions.Unauthorised, | 1223 self.assertRaises(exceptions.Unauthorised, |
| 1224 actions.EditItemAction(cl).handle) | 1224 actions.EditItemAction(cl).handle) |
| 1225 | 1225 |
| 1247 cl = self._make_client({'password':'ob', '@confirm@password':'ob'}, | 1247 cl = self._make_client({'password':'ob', '@confirm@password':'ob'}, |
| 1248 nodeid='4', userid='4') | 1248 nodeid='4', userid='4') |
| 1249 self.assertRaises(exceptions.Redirect, | 1249 self.assertRaises(exceptions.Redirect, |
| 1250 actions.EditItemAction(cl).handle) | 1250 actions.EditItemAction(cl).handle) |
| 1251 cl = self._make_client({'password':'bob', '@confirm@password':'bob'}) | 1251 cl = self._make_client({'password':'bob', '@confirm@password':'bob'}) |
| 1252 self.failUnlessRaises(exceptions.Unauthorised, | 1252 self.assertRaises(exceptions.Unauthorised, |
| 1253 actions.EditItemAction(cl).handle) | 1253 actions.EditItemAction(cl).handle) |
| 1254 | 1254 |
| 1255 def testCreatePermission(self): | 1255 def testCreatePermission(self): |
| 1256 # this checks if we properly differentiate between create and | 1256 # this checks if we properly differentiate between create and |
| 1257 # edit permissions | 1257 # edit permissions |
