Exemplo n.º 1
0
 def testToggleAdmin_no_account_key(self):
     self.other_user_key = ''
     self.connection = db_connect()
     self.user1 = login(self.connection, '*****@*****.**', 'BlackInk')
     self.failstate = False
     try:
         toggle_admin(self.user1, self.connection, self.other_user_key)
     except ValueError:
         self.failstate = True
     self.assertTrue(self.failstate)
Exemplo n.º 2
0
 def testToggleAdmin_non_account(self):
     self.other_user_key = 'not_a_key'
     self.connection = db_connect()
     self.user1 = login(self.connection, '*****@*****.**', 'Topgun01')
     self.failstate = False
     try:
         toggle_admin(self.user1, self.connection, self.other_user_key)
     except ValueError as e:
         self.failstate = True
     self.assertTrue(self.failstate)
Exemplo n.º 3
0
 def testToggleAdmin_self(self):
     self.other_user_key = 'btna3jCd7IUsr0gflHAJl4FYg3D2'
     self.connection = db_connect()
     self.user1 = login(self.connection, '*****@*****.**', 'BlackInk')
     self.failstate = False
     try:
         toggle_admin(self.user1, self.connection, self.other_user_key)
     except ValueError as e:
         self.failstate = True
     self.assertTrue(self.failstate)
Exemplo n.º 4
0
 def testToggleAdmin(self):
     self.other_user_key = 'ygSLcuk1vFXo8VSuu0pFIgGGqg72'
     self.connection = db_connect()
     self.user1 = login(self.connection, '*****@*****.**', 'BlackInk')
     self.failstate = False
     try:
         toggle_admin(self.user1, self.connection, self.other_user_key)
     except ValueError as e:
         self.failstate = True
     self.assertFalse(self.failstate)
     try:
         self.user2 = login(self.connection, '*****@*****.**', 'Topgun01')
     except ValueError as e:
         self.failstate = True
     toggle_admin(self.user1, self.connection, self.other_user_key) #undo toggle
     self.assertTrue(self.failstate)
Exemplo n.º 5
0
 def _admin_toggle(self):
     toggle_admin(self._admin, self._connection, self._selected_uid)
     self._selected_uid=''
     self.__refresh()