Projet

Général

Profil

0001-iparapheur-use-title-slug-as-identifier-33865.patch

Emmanuel Cazenave, 12 juin 2019 11:01

Télécharger (2,1 ko)

Voir les différences:

Subject: [PATCH] iparapheur: use title slug as identifier (#33865)

 passerelle/contrib/iparapheur/models.py | 3 ++-
 tests/test_iparapheur.py                | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
passerelle/contrib/iparapheur/models.py
21 21
from requests.exceptions import ConnectionError
22 22
from django.db import models
23 23
from django.core.urlresolvers import reverse
24
from django.utils.text import slugify
24 25
from django.utils.translation import ugettext_lazy as _
25 26
from django.http import HttpResponse, Http404
26 27

  
......
149 150
        doc_type = soap_client.get_type('ns0:TypeDoc')
150 151
        doc = doc_type(content, content_type)
151 152
        parameters = {'TypeTechnique': typ,
152
                      'DossierID': 'bof_id_nico',
153
                      'DossierID': slugify(title),
153 154
                      'DossierTitre': title,
154 155
                      'SousType': subtyp,
155 156
                      'Visibilite': visibility,
tests/test_iparapheur.py
121 121
        xml = ET.fromstring(mocked_post.call_args[1].get('data'))
122 122
        req = xml.find('soap:Body', SOAP_NAMESPACES).find('ns1:CreerDossierRequest', SOAP_NAMESPACES)
123 123
        assert req.find('ns1:DossierTitre', SOAP_NAMESPACES).text == title
124
        assert req.find('ns1:DossierID', SOAP_NAMESPACES).text == title
124 125
        assert req.find('ns1:TypeTechnique', SOAP_NAMESPACES).text == typ
125 126
        assert req.find('ns1:SousType', SOAP_NAMESPACES).text == subtyp
126 127
        assert req.find('ns1:Visibilite', SOAP_NAMESPACES).text == visibility
127
-