iparapheur: use title slug as identifier (#33865)

This commit is contained in:
Emmanuel Cazenave 2019-06-12 10:30:03 +02:00
parent 5c0b3012ca
commit 166d2cad05
2 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import urllib
from requests.exceptions import ConnectionError
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from django.http import HttpResponse, Http404
@ -149,7 +150,7 @@ class IParapheur(BaseResource, HTTPResource):
doc_type = soap_client.get_type('ns0:TypeDoc')
doc = doc_type(content, content_type)
parameters = {'TypeTechnique': typ,
'DossierID': 'bof_id_nico',
'DossierID': slugify(title),
'DossierTitre': title,
'SousType': subtyp,
'Visibilite': visibility,

View File

@ -121,6 +121,7 @@ def test_create_file(mocked_post, mocked_get, app, conn):
xml = ET.fromstring(mocked_post.call_args[1].get('data'))
req = xml.find('soap:Body', SOAP_NAMESPACES).find('ns1:CreerDossierRequest', SOAP_NAMESPACES)
assert req.find('ns1:DossierTitre', SOAP_NAMESPACES).text == title
assert req.find('ns1:DossierID', SOAP_NAMESPACES).text == title
assert req.find('ns1:TypeTechnique', SOAP_NAMESPACES).text == typ
assert req.find('ns1:SousType', SOAP_NAMESPACES).text == subtyp
assert req.find('ns1:Visibilite', SOAP_NAMESPACES).text == visibility