From f2a0ac11c6b192d7acc89a99e2b80e14e37c64bc Mon Sep 17 00:00:00 2001 From: Josue Kouka Date: Tue, 14 Feb 2017 17:14:08 +0100 Subject: [PATCH 1/2] don't use PhantomJS when using archimed ws (#14967) --- mandayejs/urls.py | 5 +- mandayejs/views.py | 55 +-- tests/data/archimed_account_detail_response.json | 524 +++++++++++++++++++++++ tests/data/archimed_auth_failure_response.json | 18 + tests/data/archimed_auth_success_response.json | 6 + 5 files changed, 570 insertions(+), 38 deletions(-) create mode 100644 tests/data/archimed_account_detail_response.json create mode 100644 tests/data/archimed_auth_failure_response.json create mode 100644 tests/data/archimed_auth_success_response.json diff --git a/mandayejs/urls.py b/mandayejs/urls.py index 46e6c31..2f7a643 100644 --- a/mandayejs/urls.py +++ b/mandayejs/urls.py @@ -28,8 +28,8 @@ urlpatterns = patterns('', url(r'^_mandaye/post-login/$', 'mandayejs.mandaye.views.post_login', name='post-login'), url(r'^_mandaye/post-login-do/$', 'mandayejs.mandaye.views.post_login_do', name='post-login-do'), url(r'^_mandaye/admin/', include(admin.site.urls)), - url(r'^_mandaye/ws/(?P.*)$', app_web_services), - url(r'^_mandaye/api/','mandayejs.mandaye.api.api', name='api') + url(r'^_mandaye/ws/(?P.*)$', app_web_services, name='app-web-services'), + url(r'^_mandaye/api/', 'mandayejs.mandaye.api.api', name='api') ) if 'mellon' in settings.INSTALLED_APPS: @@ -37,4 +37,3 @@ if 'mellon' in settings.INSTALLED_APPS: url(r'^_mandaye/logout/$', 'mandayejs.mandaye.views.logout', name='logout'), url(r'^_mandaye/accounts/mellon/', include('mellon.urls')), ) - diff --git a/mandayejs/views.py b/mandayejs/views.py index 02cf9aa..04368ac 100644 --- a/mandayejs/views.py +++ b/mandayejs/views.py @@ -18,8 +18,6 @@ from __future__ import absolute_import import logging import requests -from pprint import pprint -from requests.cookies import RequestsCookieJar from django.contrib.auth.models import User from django.shortcuts import get_object_or_404 @@ -29,7 +27,6 @@ from rest_framework.views import APIView from rest_framework.response import Response from mandayejs.mandaye.models import UserCredentials -from mandayejs.mandaye.utils import exec_phantom, get_login_info from mandayejs.applications import get_app_settings @@ -40,43 +37,31 @@ class ArchimedAccountDetails(APIView): def get(self, request, *args, **kwargs): logger = logging.getLogger(__name__) app_settings = get_app_settings() - - ws_uri = app_settings.SITE_WS_ENDPOINT['account_details'] + ws_uri = request.build_absolute_uri( + app_settings.SITE_WS_ENDPOINT['account_details']) username = kwargs['username'] user = get_object_or_404(User, username=username) credentials = get_object_or_404(UserCredentials, user=user) - login_info = get_login_info(request, credentials) - logger.debug(login_info) - login_info['locators'] = [credentials.to_login_info(decrypt=True)] - result = exec_phantom(login_info) - - if result.get('result') != 'ok': - return Response(status=status.HTTP_401_UNAUTHORIZED) - - session = requests.session() - r_cookies = RequestsCookieJar() - - for cookie in result.get('cookies'): - r_cookies.set( - cookie['name'], - cookie['value'], - domain=cookie['domain'], - path=cookie['path'], - secure=cookie['secure'] - ) - session.cookies = r_cookies + login_url = request.build_absolute_uri( + '/DEFAULT/Ermes/Recherche/logon.svc/logon') + + with requests.Session() as session: + login_info = credentials.to_login_info(decrypt=True) + login_info = {'username': login_info['#carte'], 'password': login_info['#code']} + response = session.post(login_url, data=login_info, verify=False) + logger.debug("Archimed login response {}".format(response.json())) + if not response.json()['success']: + return Response('Authentication failed', status=status.HTTP_401_UNAUTHORIZED) + + content = { + 'codeConfig': '', + 'xslPath': 'Services/LectorShortAccount.xslt' + } + response = session.post(ws_uri, json=content, verify=False) + logger.debug("Archimed ws response {}".format(response.json())) + return Response(response.json()) - headers = { - 'Content-Type': 'application/json', - } - content = '{"codeConfig":"", "xslPath":"Services/LectorShortAccount.xslt"}' - url = request.build_absolute_uri(ws_uri) - logger.debug(url) - request_response = session.post(url, headers=headers, data=content, verify=False) - data = request_response.json() - logger.debug(pprint(data)) - return Response(data) archimed_account_details = ArchimedAccountDetails.as_view() diff --git a/tests/data/archimed_account_detail_response.json b/tests/data/archimed_account_detail_response.json new file mode 100644 index 0000000..0ee3284 --- /dev/null +++ b/tests/data/archimed_account_detail_response.json @@ -0,0 +1,524 @@ +{ + "d": { + "ClientAccount": { + "BasketCount": 0, + "BasketWhenModified": null, + "Comments": [], + "CommentsCount": 0, + "CommentsPageMax": 0, + "Facts": null, + "HasMoreComments": false, + "Identity": { + "AddressDisplay": "RUE ROSSINI 34070 WHATVEVER", + "BarCode": "1432555", + "BirthDate": "22/11/1800", + "City": null, + "Country": null, + "DisplayName": "EPONGE ", + "Email": "kevin.eponge@whatever.fr", + "ExpirationDate": "04/02/2018", + "FirstName": "EPONGE", + "LastActivityDate": "04/02/2017", + "LastName": "KEVIN", + "Library": "CAM", + "Other": [], + "PhoneNumber": "XX XX XX XX XX", + "PhoneNumberDesktop": null, + "PhoneNumberMobile": "00 11 22 33 44 55", + "RegistrationDate": "31/08/2002", + "Sex": 0, + "Solde": ".35", + "TypeAbo": "COMA", + "ZipCode": "34070" + }, + "Loans": [ + { + "Auteur": null, + "Cote": null, + "Date": null, + "DatePret": "07/01/2017", + "DateRetour": "18/02/2017", + "DisplayName": "3 minutes pour comprendre", + "DocBase": "CAMO", + "FriendlyTitleResults": [], + "HoldingId": "4053819", + "Id": null, + "IsLate": false, + "IsSoonLate": false, + "JsonData": "{\"Auteur\":null,\"Cote\":null,\"Date\":null,\"DatePret\":\"07\\/01\\/2017\",\"DateRetour\":\"18\\/02\\/2017\",\"DisplayName\":\"3 minutes pour comprendre\",\"DocBase\":\"CAMO\",\"HoldingId\":\"4053819\",\"Id\":null,\"IsLate\":false,\"IsSoonLate\":false,\"Localisation\":\"CAM\\/VH\",\"Other\":[],\"Publisher\":null,\"RecordId\":\"1004081\",\"Section\":null,\"Status\":null,\"Title\":\"3 minutes pour comprendre\",\"TypeDoc\":null}", + "LargeThumbnailUrl": "http://images.amazon.com/images/P/2702912311.08.LZZZZZZZ.jpg", + "Localisation": "CAM/VH", + "Other": [], + "Publisher": null, + "RecordId": "1004081", + "SearchItemAdapter": { + "CustomResult": "

3 minutes pour comprendre les 50 concepts, st...

\n

\n Gelly, Dave. Directeur de publication | Documentaires Adultes | Courrier du livre. Paris | 2016

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n\n

\n L'histoire du jazz, ses diff\u00e9rents styles et ses musiciens les plus embl\u00e9matiques sont pr\u00e9sent\u00e9s en 50 concepts trait\u00e9s de fa\u00e7on synth\u00e9tique. \u00a9Electre 2016\n

\n

\n

\n\n", + "FieldList": { + "Ean": [ + "9782702912317", + "9782702912317", + "978-2-7029-1231-7" + ], + "Identifier": [ + "1004081" + ], + "Isbn": [ + "978-2-7029-1231-7" + ], + "Isbn10": [ + "2702912311" + ], + "Title": [ + "3 minutes pour comprendre les 50 concepts, styles et musiciens du jazz : big bands et petits ensembles, Louis Armstrong, Ella Fitzgerald, les instruments, le boogie-woogie..." + ], + "TypeOfDocument_idx": [ + "NDA", + "DA" + ], + "sara_ean": [ + "9782702912317" + ], + "sys_base": [ + "CAMO" + ], + "sys_support": [ + "NDA" + ] + }, + "FriendlyUrl": "https://mediatheques.montpellier3m.fr/DEFAULT/rsc/2021989/3-minutes-pour-comprendre-les-50-concepts-styles-et-musiciens-du-jazz-big-bands-et-petits-ensembles-", + "GroupedResults": [], + "Resource": { + "AvNt": 0, + "Cmts": [], + "CmtsCt": 0, + "Crtr": "Gelly, Dave. Directeur de publication", + "Culture": 1036, + "Desc": "Tout public
", + "Dt": "2016", + "Frmt": "NDA", + "IICUB": false, + "Id": "ean:9782702912317", + "Pbls": "Courrier du livre. Paris", + "RscBase": "CAMO", + "RscId": "1004081", + "RscUid": 2021989, + "Site": 3, + "Status": 0, + "Subj": "Jazz -- Histoire et critique", + "Tags": [], + "Ttl": "3 minutes pour comprendre les 50 concepts, styles et musiciens du jazz : big bands et petits ensembles, Louis Armstrong, Ella Fitzgerald, les instruments, le boogie-woogie...", + "Type": "Documentaires Adultes" + }, + "SeekForHoldings": true, + "TemplateLabel": "ErmesTemplate####SHORT" + }, + "Section": null, + "Status": null, + "ThumbnailUrl": "http://images.amazon.com/images/P/2702912311.08.MZZZZZZZ.jpg", + "Title": "3 minutes pour comprendre", + "TypeDoc": null + }, + { + "Auteur": null, + "Cote": null, + "Date": null, + "DatePret": "04/02/2017", + "DateRetour": "25/02/2017", + "DisplayName": "Grand ma\u00eetre", + "DocBase": "CAMO", + "FriendlyTitleResults": [], + "HoldingId": "3687847", + "Id": null, + "IsLate": false, + "IsSoonLate": false, + "JsonData": "{\"Auteur\":null,\"Cote\":null,\"Date\":null,\"DatePret\":\"04\\/02\\/2017\",\"DateRetour\":\"25\\/02\\/2017\",\"DisplayName\":\"Grand ma\u00eetre\",\"DocBase\":\"CAMO\",\"HoldingId\":\"3687847\",\"Id\":null,\"IsLate\":false,\"IsSoonLate\":false,\"Localisation\":\"CAM\\/VH\",\"Other\":[],\"Publisher\":null,\"RecordId\":\"896472\",\"Section\":null,\"Status\":null,\"Title\":\"Grand ma\u00eetre\",\"TypeDoc\":null}", + "LargeThumbnailUrl": "http://images.amazon.com/images/P/2081262088.08.LZZZZZZZ.jpg", + "Localisation": "CAM/VH", + "Other": [], + "Publisher": null, + "RecordId": "896472", + "SearchItemAdapter": { + "CustomResult": "

Grand ma\u00eetre

\n

\n Harrison, Jim (1937-....). Auteur | Romans adultes | Flammarion. Paris | 2012

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n\n

\n Sunderson, inspecteur \u00e0 la retraite port\u00e9 sur l'alcool et obs\u00e9d\u00e9 par les femmes, traque les membres d'une secte et leur gourou autoproclam\u00e9 Grand ma\u00eetre. Flanqu\u00e9 de Mona, sa jeune voisine de 16 ans, il poursuit le sinistre personn...\n

\n

\n

\n\n", + "FieldList": { + "Ean": [ + "978-2-08-126208-9" + ], + "Identifier": [ + "896472" + ], + "Isbn": [ + "978-2-08-126208-9" + ], + "Isbn10": [ + "2081262088" + ], + "Title": [ + "Grand ma\u00eetre" + ], + "TypeOfDocument_idx": [ + "RA", + "RA", + "RA", + "RA", + "RA" + ], + "sara_ean": [ + "" + ], + "sys_base": [ + "CAMO" + ], + "sys_support": [ + "MONO" + ] + }, + "FriendlyUrl": "https://mediatheques.montpellier3m.fr/DEFAULT/rsc/1379225/grand-maitre", + "GroupedResults": [], + "Resource": { + "AvNt": 0, + "Cmts": [], + "CmtsCt": 0, + "Crtr": "Harrison, Jim (1937-....). Auteur", + "Dt": "2012", + "Frmt": "MONO", + "IICUB": false, + "Id": "isbn:978-2-08-126208-9", + "Pbls": "Flammarion. Paris", + "RscBase": "CAMO", + "RscId": "896472", + "RscUid": 1379225, + "Site": 0, + "Status": 0, + "Tags": [], + "Ttl": "Grand ma\u00eetre", + "Type": "Romans adultes" + }, + "SeekForHoldings": true, + "TemplateLabel": "ErmesTemplate####SHORT" + }, + "Section": null, + "Status": null, + "ThumbnailUrl": "http://images.amazon.com/images/P/2081262088.08.MZZZZZZZ.jpg", + "Title": "Grand ma\u00eetre", + "TypeDoc": null + } + ], + "LoansHistoric": [], + "Messages": [], + "NonValidCommentsCount": 0, + "NonValidTagsCount": 0, + "OldMessagesTimespan": 0, + "Pagination": null, + "ProfilEmprunteur": null, + "Provisions": [], + "RecentMessagesCount": 0, + "Reservations": [ + { + "Author": null, + "Category": null, + "Cote": null, + "Date": null, + "DocBase": "CAMO", + "FriendlyTitleResults": [], + "HoldingId": "4065719", + "HoldingPlace": null, + "Id": "0", + "IsAvailable": false, + "IsDeletable": false, + "JsonData": "{\"Author\":null,\"Category\":null,\"Cote\":null,\"Date\":null,\"DocBase\":\"CAMO\",\"HoldingId\":\"4065719\",\"HoldingPlace\":null,\"Id\":\"0\",\"IsAvailable\":false,\"IsDeletable\":false,\"LocalisationCode\":\"CAM\\/VH\",\"LocalisationLibelle\":\"CAM\\/VH\",\"Other\":[],\"Publisher\":null,\"Rang\":\"1\",\"RecordId\":\"1002426\",\"Status\":null,\"Title\":\"Dalton Trumbo\",\"WhenAvailableEnd\":\"17\\/07\\/2017\",\"WhenAvailableStart\":null,\"WhenCreated\":\"18\\/01\\/2017\"}", + "LargeThumbnailUrl": "http://www.adav-assoc.com/4DACTION/GetImage/213704", + "LocalisationCode": "CAM/VH", + "LocalisationLibelle": "CAM/VH", + "Other": [], + "Publisher": null, + "Rang": "1", + "RecordId": "1002426", + "SearchItemAdapter": { + "CustomResult": "

Dalton Trumbo

\n

\n Roach, Jay (1957-...). Metteur en sc\u00e8ne ou r\u00e9alisateur | Films | TF1 Vid\u00e9o | 2016 Date du film: 2015

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n\n

\n Hollywood, la guerre froide bat son plein. Alors qu'il est au sommet de son art, le sc\u00e9nariste Dalton Trumbo est accus\u00e9 d'\u00eatre communiste. Avec d'autres artistes, il devient tr\u00e8s vite infr\u00e9quentable, puis est emprisonn\u00e9 et plac\u00e9 s...\n

\n

\n

\n\n", + "FieldList": { + "Ean": [ + "3384442270175", + "nADAV213704" + ], + "Identifier": [ + "1002426" + ], + "ThumbLarge": [ + "http://www.adav-assoc.com/4DACTION/GetImage/213704" + ], + "ThumbMedium": [ + "http://www.adav-assoc.com/4DACTION/GetImage/213704" + ], + "ThumbSmall": [ + "http://www.adav-assoc.com/4DACTION/GetImage/213704" + ], + "Title": [ + "Dalton Trumbo" + ], + "TypeOfDocument_idx": [ + "DVD", + "DVD", + "DVD", + "DVD", + "DVDC", + "DVD" + ], + "sara_ean": [ + "3384442270175" + ], + "sys_base": [ + "CAMO" + ], + "sys_support": [ + "AUVI" + ] + }, + "FriendlyUrl": "https://mediatheques.montpellier3m.fr/DEFAULT/rsc/2014303/dalton-trumbo", + "GroupedResults": [], + "Resource": { + "AvNt": 0, + "Cmts": [], + "CmtsCt": 0, + "Crtr": "Roach, Jay (1957-...). Metteur en sc\u00e8ne ou r\u00e9alisateur", + "Culture": 1036, + "Desc": "Choix des langues : fran\u00e7ais, anglais
", + "Dt": "2016 Date du film: 2015", + "Frmt": "AUVI", + "IICUB": true, + "Id": "ean:3384442270175", + "Pbls": "TF1 Vid\u00e9o", + "RscBase": "CAMO", + "RscId": "1002426", + "RscUid": 2014303, + "Site": 3, + "Status": 0, + "Subj": "Cin\u00e9ma -- Etats-Unis", + "Tags": [], + "ThumbLarge": "http://ecx.images-amazon.com/images/I/51tCYX1EvvL.jpg", + "ThumbMedium": "http://ecx.images-amazon.com/images/I/51tCYX1EvvL._SL160_.jpg", + "ThumbSmall": "http://ecx.images-amazon.com/images/I/51tCYX1EvvL._SL75_.jpg", + "Ttl": "Dalton Trumbo", + "Type": "Films" + }, + "SeekForHoldings": true, + "TemplateLabel": "ErmesTemplate####SHORT" + }, + "Status": null, + "ThumbnailUrl": "http://www.adav-assoc.com/4DACTION/GetImage/213704", + "Title": "Dalton Trumbo", + "WhenAvailableEnd": "17/07/2017", + "WhenAvailableStart": null, + "WhenCreated": "18/01/2017" + }, + { + "Author": null, + "Category": null, + "Cote": null, + "Date": null, + "DocBase": "CAMO", + "FriendlyTitleResults": [], + "HoldingId": "4065539", + "HoldingPlace": null, + "Id": "0", + "IsAvailable": false, + "IsDeletable": false, + "JsonData": "{\"Author\":null,\"Category\":null,\"Cote\":null,\"Date\":null,\"DocBase\":\"CAMO\",\"HoldingId\":\"4065539\",\"HoldingPlace\":null,\"Id\":\"0\",\"IsAvailable\":false,\"IsDeletable\":false,\"LocalisationCode\":\"CAM\\/VH\",\"LocalisationLibelle\":\"CAM\\/VH\",\"Other\":[],\"Publisher\":null,\"Rang\":\"2\",\"RecordId\":\"1002422\",\"Status\":null,\"Title\":\"Caf\u00e9 Society\",\"WhenAvailableEnd\":\"17\\/07\\/2017\",\"WhenAvailableStart\":null,\"WhenCreated\":\"18\\/01\\/2017\"}", + "LargeThumbnailUrl": "http://www.adav-assoc.com/4DACTION/GetImage/213630", + "LocalisationCode": "CAM/VH", + "LocalisationLibelle": "CAM/VH", + "Other": [], + "Publisher": null, + "Rang": "2", + "RecordId": "1002422", + "SearchItemAdapter": { + "CustomResult": "

Caf\u00e9 Society

\n

\n Allen, Woody (1935-....). Metteur en sc\u00e8ne ou r\u00e9alisateur | Films | Studio Canal vid\u00e9o. Issy-les-Moulineaux | 2016 Date du film : 2016

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n\n

\n New York, dans les ann\u00e9es 1930. Coinc\u00e9 entre des parents conflictuels, un fr\u00e8re gangster et la bijouterie familiale, Bobby Dorfman a le sentiment d'\u00e9touffer ! Il d\u00e9cide donc de tenter sa chance \u00e0 Hollywood o\u00f9 son oncle Phil, puiss...\n

\n

\n

\n\n", + "FieldList": { + "Ean": [ + "5053083086725", + "nADAV213630" + ], + "Identifier": [ + "1002422" + ], + "ThumbLarge": [ + "http://www.adav-assoc.com/4DACTION/GetImage/213630" + ], + "ThumbMedium": [ + "http://www.adav-assoc.com/4DACTION/GetImage/213630" + ], + "ThumbSmall": [ + "http://www.adav-assoc.com/4DACTION/GetImage/213630" + ], + "Title": [ + "Caf\u00e9 Society" + ], + "TypeOfDocument_idx": [ + "DVD", + "DVDC", + "DVD" + ], + "sara_ean": [ + "5053083086725" + ], + "sys_base": [ + "CAMO" + ], + "sys_support": [ + "AUVI" + ] + }, + "FriendlyUrl": "https://mediatheques.montpellier3m.fr/DEFAULT/rsc/2021309/cafe-society", + "GroupedResults": [], + "Resource": { + "AvNt": 0, + "Cmts": [], + "CmtsCt": 0, + "Crtr": "Allen, Woody (1935-....). Metteur en sc\u00e8ne ou r\u00e9alisateur", + "Culture": 1036, + "Desc": "Produit par : Graviers Productions
", + "Dt": "2016 Date du film : 2016", + "Frmt": "AUVI", + "IICUB": true, + "Id": "ean:5053083086725", + "Pbls": "Studio Canal vid\u00e9o. Issy-les-Moulineaux", + "RscBase": "CAMO", + "RscId": "1002422", + "RscUid": 2021309, + "Site": 3, + "Status": 0, + "Subj": "Cin\u00e9ma -- Etats-Unis", + "Tags": [], + "ThumbLarge": "http://ecx.images-amazon.com/images/I/51L3u-9dTJL.jpg", + "ThumbMedium": "http://ecx.images-amazon.com/images/I/51L3u-9dTJL._SL160_.jpg", + "ThumbSmall": "http://ecx.images-amazon.com/images/I/51L3u-9dTJL._SL75_.jpg", + "Ttl": "Caf\u00e9 Society", + "Type": "Films" + }, + "SeekForHoldings": true, + "TemplateLabel": "ErmesTemplate####SHORT" + }, + "Status": null, + "ThumbnailUrl": "http://www.adav-assoc.com/4DACTION/GetImage/213630", + "Title": "Caf\u00e9 Society", + "WhenAvailableEnd": "17/07/2017", + "WhenAvailableStart": null, + "WhenCreated": "18/01/2017" + }, + { + "Author": null, + "Category": null, + "Cote": null, + "Date": null, + "DocBase": "CAMO", + "FriendlyTitleResults": [], + "HoldingId": "4361106", + "HoldingPlace": null, + "Id": "0", + "IsAvailable": false, + "IsDeletable": false, + "JsonData": "{\"Author\":null,\"Category\":null,\"Cote\":null,\"Date\":null,\"DocBase\":\"CAMO\",\"HoldingId\":\"4361106\",\"HoldingPlace\":null,\"Id\":\"0\",\"IsAvailable\":false,\"IsDeletable\":false,\"LocalisationCode\":\"CAM\\/EZ\",\"LocalisationLibelle\":\"CAM\\/EZ\",\"Other\":[],\"Publisher\":null,\"Rang\":\"1\",\"RecordId\":\"1008484\",\"Status\":null,\"Title\":\"Les larmes\",\"WhenAvailableEnd\":\"04\\/08\\/2017\",\"WhenAvailableStart\":null,\"WhenCreated\":\"05\\/02\\/2017\"}", + "LargeThumbnailUrl": "http://images.amazon.com/images/P/2246861799.08.LZZZZZZZ.jpg", + "LocalisationCode": "CAM/EZ", + "LocalisationLibelle": "CAM/EZ", + "Other": [], + "Publisher": null, + "Rang": "1", + "RecordId": "1008484", + "SearchItemAdapter": { + "CustomResult": "

Les larmes : roman

\n

\n Quignard, Pascal (1948-....). Auteur | Romans adultes | Grasset. Paris | 2016

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n

\n\n

\n L'\u00e9crivain \u00e9voque l'histoire de la r\u00e9daction d'un texte marquant l'acte de naissance d'une langue romaine rustique, distincte du latin et pr\u00e9figurant la langue fran\u00e7aise : les Serments de Strasbourg, prononc\u00e9s en f\u00e9vrier 842 par C...\n

\n

\n

\n\n", + "FieldList": { + "Ean": [ + "9782246861799", + "9782246861799", + "978-2-246-86179-9" + ], + "Identifier": [ + "1008484" + ], + "Isbn": [ + "978-2-246-86179-9" + ], + "Isbn10": [ + "2246861799" + ], + "Title": [ + "Les larmes : roman" + ], + "TypeOfDocument_idx": [ + "RA" + ], + "sara_ean": [ + "9782246861799" + ], + "sys_base": [ + "CAMO" + ], + "sys_support": [ + "MONO" + ] + }, + "FriendlyUrl": "https://mediatheques.montpellier3m.fr/DEFAULT/rsc/2026733/les-larmes-roman", + "GroupedResults": [], + "Resource": { + "AvNt": 0, + "Cmts": [], + "CmtsCt": 0, + "Crtr": "Quignard, Pascal (1948-....). Auteur", + "Culture": 1036, + "Dt": "2016", + "Frmt": "MONO", + "IICUB": true, + "Id": "ean:9782246861799", + "Pbls": "Grasset. Paris", + "RscBase": "CAMO", + "RscId": "1008484", + "RscUid": 2026733, + "Site": 3, + "Status": 0, + "Tags": [], + "Ttl": "Les larmes : roman", + "Type": "Romans adultes" + }, + "SeekForHoldings": true, + "TemplateLabel": "ErmesTemplate####SHORT" + }, + "Status": null, + "ThumbnailUrl": "http://images.amazon.com/images/P/2246861799.08.MZZZZZZZ.jpg", + "Title": "Les larmes", + "WhenAvailableEnd": "04/08/2017", + "WhenAvailableStart": null, + "WhenCreated": "05/02/2017" + } + ], + "ShortAccount": { + "DescriptionEmpr": null, + "EmailEmpr": null, + "IDEmprunteur": null, + "IdentiteEmpr": null, + "MessageArray": null, + "NombreAvis": 0, + "NombreCommunicationSurPlace": 0, + "NombreDemandeReservations": 0, + "NombreMessages": 0, + "NombrePaniers": 0, + "NombrePrets": 8, + "NombrePretsReserve": 0, + "NombreRendreBientot": 0, + "NombreRendreBientotJour": 0, + "NombreRequetes": 0, + "NombreReservations": 3, + "NombreRetards": 0, + "TypeEmpr": null + }, + "Tags": [], + "TagsCount": 0, + "ValidCommentsCount": 0, + "ValidTagsCount": 0 + }, + "HtmlResult": "
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n

\r\n \r\n Mon compte lecteur\r\n \r\n

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n

Donnez-nous votre avis

\r\n
\r\n
\r\n

\r\n Les champs indiqu\u00e9s par le symbole * sont obligatoires.\r\n

\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n

\r\n \r\n Messages des biblioth\u00e9caires\r\n \r\n

\r\n
\r\n Aucun\r\n
\r\n
\r\n
\r\n

\r\n \r\n Pr\u00eats en cours\r\n \r\n

\r\n
\r\n
    \r\n
  • \r\n
    \r\n
    \r\n \"\"\r\n
    \r\n
    \r\n

    \r\n 3 minutes pour comprendre\r\n

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Localisation : \u00a0\r\n CAM/VH
    \r\n Code barre : \u00a0\r\n 4053819
    \r\n Emprunt\u00e9 le : \u00a0\r\n 07/01/2017
    \r\n Date de retour : \u00a0\r\n 18/02/2017
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  • \r\n
  • \r\n
    \r\n
    \r\n \"\"\r\n
    \r\n
    \r\n

    \r\n Grand ma\u00eetre\r\n

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Localisation : \u00a0\r\n CAM/VH
    \r\n Code barre : \u00a0\r\n 3687847
    \r\n Emprunt\u00e9 le : \u00a0\r\n 04/02/2017
    \r\n Date de retour : \u00a0\r\n 25/02/2017
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  • \r\n
  • \r\n
    \r\n
    \r\n \"\"\r\n
    \r\n
    \r\n

    \r\n Le capital au XXIe si\u00e8cle\r\n

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Localisation : \u00a0\r\n CAM/VH
    \r\n Code barre : \u00a0\r\n 3916041
    \r\n Emprunt\u00e9 le : \u00a0\r\n 04/02/2017
    \r\n Date de retour : \u00a0\r\n 25/02/2017
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  • \r\n
  • \r\n
    \r\n
    \r\n \"\"\r\n
    \r\n
    \r\n

    \r\n Aristide Maillol, Henri F\r\n

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Localisation : \u00a0\r\n CAM/VH
    \r\n Code barre : \u00a0\r\n 4040793
    \r\n Emprunt\u00e9 le : \u00a0\r\n 04/02/2017
    \r\n Date de retour : \u00a0\r\n 25/02/2017
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  • \r\n
  • \r\n
    \r\n
    \r\n \"\"\r\n
    \r\n
    \r\n

    \r\n Poss\u00e9d\u00e9es\r\n

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Localisation : \u00a0\r\n CAM/VH
    \r\n Code barre : \u00a0\r\n 4065122
    \r\n Emprunt\u00e9 le : \u00a0\r\n 04/02/2017
    \r\n Date de retour : \u00a0\r\n 25/02/2017
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  • \r\n
  • \r\n
    \r\n
    \r\n \"\"\r\n
    \r\n
    \r\n

    \r\n Les voyages d'Ulysse\r\n

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Localisation : \u00a0\r\n CAM/VH
    \r\n Code barre : \u00a0\r\n 4294343
    \r\n Emprunt\u00e9 le : \u00a0\r\n 04/02/2017
    \r\n Date de retour : \u00a0\r\n 25/02/2017
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  • \r\n
  • \r\n
    \r\n
    \r\n \"\"\r\n
    \r\n
    \r\n

    \r\n Les dinosaures\r\n

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Localisation : \u00a0\r\n CAM/VH
    \r\n Code barre : \u00a0\r\n 3540417
    \r\n Emprunt\u00e9 le : \u00a0\r\n 09/02/2017
    \r\n Date de retour : \u00a0\r\n 02/03/2017
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  • \r\n
  • \r\n
    \r\n
    \r\n \"\"\r\n
    \r\n
    \r\n

    \r\n Ada\r\n

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Localisation : \u00a0\r\n CAM/VH
    \r\n Code barre : \u00a0\r\n 4177940
    \r\n Emprunt\u00e9 le : \u00a0\r\n 09/02/2017
    \r\n Date de retour : \u00a0\r\n 02/03/2017
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  • \r\n
\r\n
\r\n
\r\n
\r\n

\r\n \r\n R\u00e9servations en cours\r\n \r\n

\r\n
\r\n
    \r\n
  • \r\n
    \r\n
    \r\n \"\"\r\n
    \r\n
    \r\n

    \r\n Dalton Trumbo\r\n

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Code barre : \r\n 4065719
    \r\n R\u00e9serv\u00e9 le : \r\n 18/01/2017
    \r\n Fin de validit\u00e9 :\r\n 17/07/2017
    \r\n Rang\r\n 1
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  • \r\n
  • \r\n
    \r\n
    \r\n \"\"\r\n
    \r\n
    \r\n

    \r\n Caf\u00e9 Society\r\n

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Code barre : \r\n 4065539
    \r\n R\u00e9serv\u00e9 le : \r\n 18/01/2017
    \r\n Fin de validit\u00e9 :\r\n 17/07/2017
    \r\n Rang\r\n 2
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  • \r\n
  • \r\n
    \r\n
    \r\n \"\"\r\n
    \r\n
    \r\n

    \r\n Les larmes\r\n

    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    \r\n Code barre : \r\n 4361106
    \r\n R\u00e9serv\u00e9 le : \r\n 05/02/2017
    \r\n Fin de validit\u00e9 :\r\n 04/08/2017
    \r\n Rang\r\n 1
    \r\n
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    \r\n
  • \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
", + "RscBase": "CAMO" + }, + "errors": [], + "message": "Whatever is whatever", + "success": true +} diff --git a/tests/data/archimed_auth_failure_response.json b/tests/data/archimed_auth_failure_response.json new file mode 100644 index 0000000..b2c99f9 --- /dev/null +++ b/tests/data/archimed_auth_failure_response.json @@ -0,0 +1,18 @@ +{ + "d": "Anonymous", + "errors": [ + { + "data": { + "__type": "ObjectCollection:#Archimed.Serialization", + "badPasswordCount": 0, + "checkAdditionalsResult": true, + "doCheckAdditionals": true + }, + "id": "CF30AuthenticationProvider", + "msg": "L'utilisateur sp\u00e9cifi\u00e9 est introuvable, v\u00e9rifiez la syntaxe et r\u00e9essayez.", + "type": "UserNotFound" + } + ], + "message": "", + "success": false +} \ No newline at end of file diff --git a/tests/data/archimed_auth_success_response.json b/tests/data/archimed_auth_success_response.json new file mode 100644 index 0000000..e5e1251 --- /dev/null +++ b/tests/data/archimed_auth_success_response.json @@ -0,0 +1,6 @@ +{ + "d": "1432555", + "errors": [], + "message": "", + "success": true +} \ No newline at end of file -- 2.11.0