def test_delete_accounts_except_admins_rql_driver_error(self):
     with self.app.test_request_context():
         with patch.object(Interactions, 'delete_specific',
                           side_effect=RqlDriverError(None)):
             response = delete_accounts_except_admins()
             self.assertRaises(RqlDriverError)
             self.assertEqual(response.status_code,
                              client.INTERNAL_SERVER_ERROR)
 def test_delete_accounts_except_admins(self):
     with self.app.test_request_context():
         with patch.object(Interactions, "delete_specific", return_value={}):
             response = delete_accounts_except_admins()
             self.assertEqual(response.status_code, client.OK)
Esempio n. 3
0
 def delete(self):
     """
     Deletes all records (except admin) in the Accounts table
     """
     return delete_accounts_except_admins()
 def test_delete_accounts_except_admins(self):
     with self.app.test_request_context():
         with patch.object(Interactions, 'delete_specific',
                           return_value={}):
             response = delete_accounts_except_admins()
             self.assertEqual(response.status_code, client.OK)
Esempio n. 5
0
 def delete(self):
     """
     Deletes all records (except admin) in the Accounts table
     """
     return delete_accounts_except_admins()