comparison test/test_actions.py @ 5119:748ba87e1aca

Added a new cgi action restore. The opposite of (and a clone of) the existing retire action.
author John Rouillard <rouilj@ieee.org>
date Sun, 03 Jul 2016 10:38:47 -0400
parents 156cbc1d182c
children 894aa07be6cb
comparison
equal deleted inserted replaced
5118:57452bc6d989 5119:748ba87e1aca
83 self.assertRaises(ValueError, RetireAction(self.client).handle) 83 self.assertRaises(ValueError, RetireAction(self.client).handle)
84 # .. or anonymous 84 # .. or anonymous
85 self.client.db.user.get = lambda a,b: 'anonymous' 85 self.client.db.user.get = lambda a,b: 'anonymous'
86 self.assertRaises(ValueError, RetireAction(self.client).handle) 86 self.assertRaises(ValueError, RetireAction(self.client).handle)
87 87
88 class RestoreActionTestCase(ActionTestCase):
89 # This is a copy of the RetireActionTestCase. But what do these
90 # actually test? I see no actual db or retire call or
91 # class id. Testing db level restore is covered in the
92 # db_test_base as part of retire.
93 def testRestoreAction(self):
94 self.client.db.security.hasPermission = true
95 self.client._ok_message = []
96 RestoreAction(self.client).handle()
97 self.assert_(len(self.client._ok_message) == 1)
98
99 def testNoPermission(self):
100 self.assertRaises(Unauthorised, RestoreAction(self.client).execute)
101
88 class SearchActionTestCase(ActionTestCase): 102 class SearchActionTestCase(ActionTestCase):
89 def setUp(self): 103 def setUp(self):
90 ActionTestCase.setUp(self) 104 ActionTestCase.setUp(self)
91 self.action = SearchAction(self.client) 105 self.action = SearchAction(self.client)
92 106

Roundup Issue Tracker: http://roundup-tracker.org/