Esempio n. 1
0
    def test_remove(self):
        with self.current_api.app_context():
            ClientService.add('admin1', '*****@*****.**')
            client = ClientService.get_by_email('*****@*****.**')

            deleted_client = ClientService.remove(client.id)
            self.assertEqual(deleted_client.id, client.id)

            deleted_client = ClientService.remove(987)
            self.assertEqual(deleted_client, None)
Esempio n. 2
0
def delete_client(client_id):
    client = ClientService.remove(client_id)

    if client == None:
        abort(404)

    client_schema = ClientSchema()
    return client_schema.jsonify(client)