def test_delete_account(self, delete_registration_method):
        delete_registration_method.return_value = None

        with self.app.test_request_context():
            with patch.object(Interactions, "delete_specific", return_value=[{"id": "123"}]):
                with patch.object(Interactions, "query", return_value={}):
                    with patch.object(Interactions, "delete", return_value={}):
                        response = delete_account("123")
                        self.assertEqual(response.status_code, client.OK)
    def test_delete_account(self, delete_registration_method):
        delete_registration_method.return_value = None

        with self.app.test_request_context():
            with patch.object(Interactions, 'delete_specific',
                              return_value=[{'id': '123'}]):
                with patch.object(Interactions, 'query',
                                  return_value={}):
                    with patch.object(Interactions, 'delete',
                                      return_value={}):
                        response = delete_account('123')
                        self.assertEqual(response.status_code, client.OK)
Пример #3
0
    def delete(self, account_id):
        """
        Deletes account record
        """
        return_val = validate_access(
            request.headers['username'],
            incoming_account_id=account_id)

        if return_val:
            return return_val

        return delete_account(account_id)