|
|
|
@ -961,15 +961,15 @@ def test_read_regie_list(con, app):
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
assert len(resp.json['data']) == 9
|
|
|
|
|
assert resp.json['data'] == [
|
|
|
|
|
{'id': 101, 'code': 101, 'text': 'ACTIONS SOCIO CULTURELLES', 'libelle': 'ACTIONS SOCIO CULTURELLES'},
|
|
|
|
|
{'id': 102, 'code': 102, 'text': 'CANTINE / CLAE', 'libelle': 'CANTINE / CLAE'},
|
|
|
|
|
{'id': 103, 'code': 103, 'text': 'CCAS', 'libelle': 'CCAS'},
|
|
|
|
|
{'id': 101, 'code': 101, 'text': 'DASC', 'libelle': 'DASC'},
|
|
|
|
|
{'id': 102, 'code': 102, 'text': 'DE - CANTINE / CLAE', 'libelle': 'DE - CANTINE / CLAE'},
|
|
|
|
|
{'id': 106, 'code': 106, 'text': 'DE - PARCOURS EDUCATIFS', 'libelle': 'DE - PARCOURS EDUCATIFS'},
|
|
|
|
|
{'id': 109, 'code': 109, 'text': 'DSBL', 'libelle': 'DSBL'},
|
|
|
|
|
{'id': 104, 'code': 104, 'text': 'DSCS', 'libelle': 'DSCS'},
|
|
|
|
|
{'id': 105, 'code': 105, 'text': 'ENFANCE LOISIRS', 'libelle': 'ENFANCE LOISIRS'},
|
|
|
|
|
{'id': 106, 'code': 106, 'text': 'PARCOURS EDUCATIFS', 'libelle': 'PARCOURS EDUCATIFS'},
|
|
|
|
|
{'id': 105, 'code': 105, 'text': 'ENFANCE LOISIRS ET PE', 'libelle': 'ENFANCE LOISIRS ET PE'},
|
|
|
|
|
{'id': 107, 'code': 107, 'text': 'REMBOURSEMENT', 'libelle': 'REMBOURSEMENT'},
|
|
|
|
|
{'id': 108, 'code': 108, 'text': 'SENIORS', 'libelle': 'SENIORS'},
|
|
|
|
|
{'id': 109, 'code': 109, 'text': 'SPORT', 'libelle': 'SPORT'},
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -8458,57 +8458,56 @@ def test_get_baskets(activity_service, con, app):
|
|
|
|
|
activity_service.add_soap_response('getFamilyBasket', get_xml_file('R_get_family_basket.xml'))
|
|
|
|
|
url = get_endpoint('get-baskets')
|
|
|
|
|
|
|
|
|
|
resp = app.get(url + '?family_id=311352')
|
|
|
|
|
resp = app.get(url + '?family_id=1312')
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
Link.objects.create(resource=con, family_id='311352', name_id='local')
|
|
|
|
|
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
|
|
|
|
|
|
|
|
|
resp = app.get(url + '?NameID=local')
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
data = resp.json['data']
|
|
|
|
|
assert len(data[0]['lignes']) == 3
|
|
|
|
|
del data[0]['lignes'][2]
|
|
|
|
|
assert len(data[0]['lignes']) == 2
|
|
|
|
|
del data[0]['lignes'][1]
|
|
|
|
|
assert data[0] == {
|
|
|
|
|
'id': 'S10053200723',
|
|
|
|
|
'text': 'ENFANCE LOISIRS',
|
|
|
|
|
'codeRegie': 105,
|
|
|
|
|
'dateAdd': '2023-01-28T23:56:23+01:00',
|
|
|
|
|
'dateMaj': '2023-01-28T23:56:23+01:00',
|
|
|
|
|
'delai': 0,
|
|
|
|
|
'idFam': 'S10053183425',
|
|
|
|
|
'id': 'S10055641661',
|
|
|
|
|
'text': 'DSBL',
|
|
|
|
|
'codeRegie': 109,
|
|
|
|
|
'dateAdd': '2023-04-20T12:05:51+02:00',
|
|
|
|
|
'dateMaj': '2023-04-20T12:05:42+02:00',
|
|
|
|
|
'delai': 30,
|
|
|
|
|
'idFam': 'S10055638201',
|
|
|
|
|
'lignes': [
|
|
|
|
|
{
|
|
|
|
|
'datEchn': None,
|
|
|
|
|
'dateMaj': '2023-01-28T23:56:23+01:00',
|
|
|
|
|
'id': 'S10053203120',
|
|
|
|
|
'idIns': 'S10053203118',
|
|
|
|
|
'idInsLieu': 'S10053203119',
|
|
|
|
|
'idPanier': 'S10053200723',
|
|
|
|
|
'inscription': {
|
|
|
|
|
'dateDeb': '2023-02-20T00:00:00+01:00',
|
|
|
|
|
'dateFin': '2023-02-24T00:00:00+01:00',
|
|
|
|
|
'idAct': 'A10053187065',
|
|
|
|
|
'idInsAct': 'S10053203118',
|
|
|
|
|
'idInsLieu': 'S10053203119',
|
|
|
|
|
'idLieu': 'A10053179604',
|
|
|
|
|
'idRegie': 'A10049327667',
|
|
|
|
|
'idUnit': 'A10053187085',
|
|
|
|
|
'libAct': 'Vacances Hivers 2023',
|
|
|
|
|
'libAct2': None,
|
|
|
|
|
'libLieu': 'ALEX JANY',
|
|
|
|
|
'libUnit': 'Semaine 1',
|
|
|
|
|
},
|
|
|
|
|
'montant': 0.0,
|
|
|
|
|
'personneInfo': {
|
|
|
|
|
'dateBirth': '2014-04-01T00:00:00+02:00',
|
|
|
|
|
'firstname': 'BART',
|
|
|
|
|
'lastname': 'NICO',
|
|
|
|
|
'numPerson': 246711,
|
|
|
|
|
'sexe': 'M',
|
|
|
|
|
'dateBirth': '2016-05-09T00:00:00+02:00',
|
|
|
|
|
'firstname': 'LISA',
|
|
|
|
|
'lastname': 'EO_NICOLAS',
|
|
|
|
|
'numPerson': 266148,
|
|
|
|
|
'sexe': 'F',
|
|
|
|
|
},
|
|
|
|
|
'prixUnit': 43.0,
|
|
|
|
|
'qte': 0.0,
|
|
|
|
|
},
|
|
|
|
|
'idPanier': 'S10055641661',
|
|
|
|
|
'id': 'S10055641668',
|
|
|
|
|
'idIns': 'S10055641665',
|
|
|
|
|
'idInsLieu': 'S10055641666',
|
|
|
|
|
'inscription': {
|
|
|
|
|
'dateDeb': '2023-02-01T00:00:00+01:00',
|
|
|
|
|
'dateFin': '2023-06-30T00:00:00+02:00',
|
|
|
|
|
'idAct': 'A10053179798',
|
|
|
|
|
'idInsAct': 'S10055641665',
|
|
|
|
|
'idInsLieu': 'S10055641666',
|
|
|
|
|
'idLieu': 'A10053179757',
|
|
|
|
|
'idRegie': 'A10049327667',
|
|
|
|
|
'idUnit': 'A10053179809',
|
|
|
|
|
'libAct': 'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES',
|
|
|
|
|
'libAct2': None,
|
|
|
|
|
'libLieu': 'ARGOULETS',
|
|
|
|
|
'libUnit': 'MERCREDI - 15h30/17h - 8/15Ans',
|
|
|
|
|
},
|
|
|
|
|
'qte': 1.0,
|
|
|
|
|
'prixUnit': 150.0,
|
|
|
|
|
'montant': 150.0,
|
|
|
|
|
'datEchn': '2023-12-31T00:00:00+01:00',
|
|
|
|
|
'dateMaj': '2023-04-20T12:05:51+02:00',
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -8530,9 +8529,10 @@ def test_get_baskets_no_basket(activity_service, con, app):
|
|
|
|
|
|
|
|
|
|
def test_update_basket_time(activity_service, con, app):
|
|
|
|
|
activity_service.add_soap_response('getFamilyBasket', get_xml_file('R_get_family_basket.xml'))
|
|
|
|
|
|
|
|
|
|
activity_service.add_soap_response('updateBasketTime', get_xml_file('R_update_basket_time.xml'))
|
|
|
|
|
url = get_endpoint('update-basket-time')
|
|
|
|
|
params = {'basket_id': 'S10053200723'}
|
|
|
|
|
params = {'basket_id': 'S10055641661'}
|
|
|
|
|
|
|
|
|
|
resp = app.post_json(url + '?family_id=311352', params=params)
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
@ -8545,7 +8545,7 @@ def test_update_basket_time(activity_service, con, app):
|
|
|
|
|
|
|
|
|
|
def test_update_basket_time_not_linked_error(con, app):
|
|
|
|
|
url = get_endpoint('update-basket-time')
|
|
|
|
|
params = {'basket_id': 'S10053200723'}
|
|
|
|
|
params = {'basket_id': 'S10055641661'}
|
|
|
|
|
resp = app.post_json(url + '?NameID=local', params=params)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == 'User not linked to family'
|
|
|
|
@ -8554,10 +8554,10 @@ def test_update_basket_time_not_linked_error(con, app):
|
|
|
|
|
def test_update_basket_time_no_basket(activity_service, con, app):
|
|
|
|
|
activity_service.add_soap_response('getFamilyBasket', get_xml_file('R_get_family_basket_empty.xml'))
|
|
|
|
|
url = get_endpoint('update-basket-time')
|
|
|
|
|
params = {'basket_id': 'S10053200723'}
|
|
|
|
|
params = {'basket_id': 'S10055641661'}
|
|
|
|
|
resp = app.post_json(url + '?family_id=311352', params=params)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == "no 'S10053200723' basket on family"
|
|
|
|
|
assert resp.json['err_desc'] == "no 'S10055641661' basket on family"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_update_basket_time_basket_not_found(activity_service, con, app):
|
|
|
|
@ -8575,7 +8575,7 @@ def test_delete_basket_line(activity_service, con, app):
|
|
|
|
|
'deletePersonUnitBasket', get_xml_file('R_delete_person_unit_basket.xml')
|
|
|
|
|
)
|
|
|
|
|
url = get_endpoint('delete-basket-line')
|
|
|
|
|
params = {'basket_id': 'S10053200723', 'line_id': 'S10053203120'}
|
|
|
|
|
params = {'basket_id': 'S10055641661', 'line_id': 'S10055641668'}
|
|
|
|
|
|
|
|
|
|
resp = app.post_json(url + '?family_id=311352', params=params)
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
@ -8584,12 +8584,12 @@ def test_delete_basket_line(activity_service, con, app):
|
|
|
|
|
resp = app.post_json(url + '?NameID=local', params=params)
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
assert len(resp.json['data']['lignes']) == 2 # return the basket
|
|
|
|
|
assert 'S10053203120' not in [x['id'] for x in resp.json['data']['lignes']]
|
|
|
|
|
assert 'S10055641668' not in [x['id'] for x in resp.json['data']['lignes']]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_delete_basket_line_not_linked_error(con, app):
|
|
|
|
|
url = get_endpoint('delete-basket-line')
|
|
|
|
|
params = {'basket_id': 'S10053200723', 'line_id': 'S10053203120'}
|
|
|
|
|
params = {'basket_id': 'S10055641661', 'line_id': 'S10055641668'}
|
|
|
|
|
resp = app.post_json(url + '?NameID=local', params=params)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == 'User not linked to family'
|
|
|
|
@ -8598,16 +8598,16 @@ def test_delete_basket_line_not_linked_error(con, app):
|
|
|
|
|
def test_delete_basket_line_no_basket(activity_service, con, app):
|
|
|
|
|
activity_service.add_soap_response('getFamilyBasket', get_xml_file('R_get_family_basket_empty.xml'))
|
|
|
|
|
url = get_endpoint('delete-basket-line')
|
|
|
|
|
params = {'basket_id': 'S10053200723', 'line_id': 'S10053203120'}
|
|
|
|
|
params = {'basket_id': 'S10055641661', 'line_id': 'S10055641668'}
|
|
|
|
|
resp = app.post_json(url + '?family_id=311352', params=params)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == "no 'S10053200723' basket on family"
|
|
|
|
|
assert resp.json['err_desc'] == "no 'S10055641661' basket on family"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_delete_basket_line_basket_not_found(activity_service, con, app):
|
|
|
|
|
activity_service.add_soap_response('getFamilyBasket', get_xml_file('R_get_family_basket.xml'))
|
|
|
|
|
url = get_endpoint('delete-basket-line')
|
|
|
|
|
params = {'basket_id': 'plop', 'line_id': 'S10053203120'}
|
|
|
|
|
params = {'basket_id': 'plop', 'line_id': 'S10055641668'}
|
|
|
|
|
resp = app.post_json(url + '?family_id=311352', params=params)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == "no 'plop' basket on family"
|
|
|
|
@ -8616,7 +8616,7 @@ def test_delete_basket_line_basket_not_found(activity_service, con, app):
|
|
|
|
|
def test_delete_basket_line_line_not_found(activity_service, con, app):
|
|
|
|
|
activity_service.add_soap_response('getFamilyBasket', get_xml_file('R_get_family_basket.xml'))
|
|
|
|
|
url = get_endpoint('delete-basket-line')
|
|
|
|
|
params = {'basket_id': 'S10053200723', 'line_id': 'plop'}
|
|
|
|
|
params = {'basket_id': 'S10055641661', 'line_id': 'plop'}
|
|
|
|
|
resp = app.post_json(url + '?family_id=311352', params=params)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == "no 'plop' basket line on basket"
|
|
|
|
@ -8633,7 +8633,7 @@ def test_delete_basket(activity_service, con, app):
|
|
|
|
|
request_check=request_check,
|
|
|
|
|
)
|
|
|
|
|
url = get_endpoint('delete-basket')
|
|
|
|
|
params = {'basket_id': 'S10053200723'}
|
|
|
|
|
params = {'basket_id': 'S10055641661'}
|
|
|
|
|
|
|
|
|
|
resp = app.post_json(url + '?family_id=311352', params=params)
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
@ -8646,7 +8646,7 @@ def test_delete_basket(activity_service, con, app):
|
|
|
|
|
|
|
|
|
|
def test_delete_basket_not_linked_error(con, app):
|
|
|
|
|
url = get_endpoint('delete-basket')
|
|
|
|
|
params = {'basket_id': 'S10053200723'}
|
|
|
|
|
params = {'basket_id': 'S10055641661'}
|
|
|
|
|
resp = app.post_json(url + '?NameID=local', params=params)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == 'User not linked to family'
|
|
|
|
@ -8655,10 +8655,10 @@ def test_delete_basket_not_linked_error(con, app):
|
|
|
|
|
def test_delete_basket_no_basket(activity_service, con, app):
|
|
|
|
|
activity_service.add_soap_response('getFamilyBasket', get_xml_file('R_get_family_basket_empty.xml'))
|
|
|
|
|
url = get_endpoint('delete-basket')
|
|
|
|
|
params = {'basket_id': 'S10053200723'}
|
|
|
|
|
params = {'basket_id': 'S10055641661'}
|
|
|
|
|
resp = app.post_json(url + '?family_id=311352', params=params)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == "no 'S10053200723' basket on family"
|
|
|
|
|
assert resp.json['err_desc'] == "no 'S10055641661' basket on family"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_delete_basket_not_found(activity_service, con, app):
|
|
|
|
@ -8674,7 +8674,7 @@ def test_validate_basket(activity_service, con, app):
|
|
|
|
|
activity_service.add_soap_response('getFamilyBasket', get_xml_file('R_get_family_basket.xml'))
|
|
|
|
|
activity_service.add_soap_response('validateBasket', get_xml_file('R_validate_basket.xml'))
|
|
|
|
|
url = get_endpoint('validate-basket')
|
|
|
|
|
params = {'basket_id': 'S10053200723'}
|
|
|
|
|
params = {'basket_id': 'S10055641661'}
|
|
|
|
|
|
|
|
|
|
resp = app.post_json(url + '?family_id=311352', params=params)
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
@ -8683,15 +8683,74 @@ def test_validate_basket(activity_service, con, app):
|
|
|
|
|
resp = app.post_json(url + '?NameID=local', params=params)
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
assert resp.json['data'] == {
|
|
|
|
|
'idFam': 'S10053183425',
|
|
|
|
|
'factureLst': [],
|
|
|
|
|
'idInsLst': ['S10053203103', 'S10053200721'],
|
|
|
|
|
'idFam': 'S10055638201',
|
|
|
|
|
'factureLst': [
|
|
|
|
|
{
|
|
|
|
|
'numInvoice': '18',
|
|
|
|
|
'idInvoice': 'F10055641671',
|
|
|
|
|
'libelleTTF': 'DSBL TEST',
|
|
|
|
|
'regie': {'code': 109, 'libelle': 'DSBL'},
|
|
|
|
|
'numFamily': 322802,
|
|
|
|
|
'name': 'EO_NICOLAS MARGE',
|
|
|
|
|
'refTIPI': None,
|
|
|
|
|
'amountInvoice': '300',
|
|
|
|
|
'amountPaid': '0',
|
|
|
|
|
'amountPaidTG': '0',
|
|
|
|
|
'dateInvoice': '2023-04-20T00:00:00+02:00',
|
|
|
|
|
'dateStartPayment': None,
|
|
|
|
|
'dateDeadline': '2023-12-31T00:00:00+01:00',
|
|
|
|
|
'dateDeadlinePayment': None,
|
|
|
|
|
'dateTIPI': None,
|
|
|
|
|
'authTIPI': None,
|
|
|
|
|
'pdfName': None,
|
|
|
|
|
'pdfFile': None,
|
|
|
|
|
'payer': {
|
|
|
|
|
'num': 266143,
|
|
|
|
|
'lastname': 'EO_NICOLAS',
|
|
|
|
|
'firstname': 'MARGE',
|
|
|
|
|
'sexe': None,
|
|
|
|
|
'civility': 'MME',
|
|
|
|
|
'mail': None,
|
|
|
|
|
},
|
|
|
|
|
'lineInvoiceList': [
|
|
|
|
|
{
|
|
|
|
|
'numLine': 1,
|
|
|
|
|
'numPers': '266148',
|
|
|
|
|
'idActivity': 'A10053179798',
|
|
|
|
|
'idUnit': 'A10053179809',
|
|
|
|
|
'idIns': 'S10055641665',
|
|
|
|
|
'libelleLine': 'PORTAIL MERCREDI - 15h30/17h - 8/15Ans',
|
|
|
|
|
'name': 'EO_NICOLAS LISA',
|
|
|
|
|
'dateStart': '2023-02-01T00:00:00+01:00',
|
|
|
|
|
'dateEnd': '2023-06-30T00:00:00+02:00',
|
|
|
|
|
'quantity': 1.0,
|
|
|
|
|
'unitPrice': 150.0,
|
|
|
|
|
'amountLine': '150',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
'numLine': 2,
|
|
|
|
|
'numPers': '266145',
|
|
|
|
|
'idActivity': 'A10053179798',
|
|
|
|
|
'idUnit': 'A10053179809',
|
|
|
|
|
'idIns': 'S10055641658',
|
|
|
|
|
'libelleLine': 'PORTAIL MERCREDI - 15h30/17h - 8/15Ans',
|
|
|
|
|
'name': 'EO_NICOLAS BART',
|
|
|
|
|
'dateStart': '2023-02-01T00:00:00+01:00',
|
|
|
|
|
'dateEnd': '2023-06-30T00:00:00+02:00',
|
|
|
|
|
'quantity': 1.0,
|
|
|
|
|
'unitPrice': 150.0,
|
|
|
|
|
'amountLine': '150',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
'idInsLst': ['S10055641665', 'S10055641658'],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_validate_basket_not_linked_error(con, app):
|
|
|
|
|
url = get_endpoint('validate-basket')
|
|
|
|
|
params = {'basket_id': 'S10053200723'}
|
|
|
|
|
params = {'basket_id': 'S10055641661'}
|
|
|
|
|
resp = app.post_json(url + '?NameID=local', params=params)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == 'User not linked to family'
|
|
|
|
@ -8700,10 +8759,10 @@ def test_validate_basket_not_linked_error(con, app):
|
|
|
|
|
def test_validate_basket_no_basket(activity_service, con, app):
|
|
|
|
|
activity_service.add_soap_response('getFamilyBasket', get_xml_file('R_get_family_basket_empty.xml'))
|
|
|
|
|
url = get_endpoint('validate-basket')
|
|
|
|
|
params = {'basket_id': 'S10053200723'}
|
|
|
|
|
params = {'basket_id': 'S10055641661'}
|
|
|
|
|
resp = app.post_json(url + '?family_id=311352', params=params)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == "no 'S10053200723' basket on family"
|
|
|
|
|
assert resp.json['err_desc'] == "no 'S10055641661' basket on family"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_validate_basket_not_found(activity_service, con, app):
|
|
|
|
@ -8911,21 +8970,21 @@ def test_create_nursery_demand_wrong_referential_key_error(con, app):
|
|
|
|
|
def test_invoices(invoice_service, con, app, caplog, freezer):
|
|
|
|
|
def request_check(request):
|
|
|
|
|
assert request.numDossier == 1312
|
|
|
|
|
assert request.codeRegie == 104
|
|
|
|
|
assert request.codeRegie == 102
|
|
|
|
|
assert request.dateStart == datetime.datetime(1970, 1, 1, 0, 0)
|
|
|
|
|
|
|
|
|
|
invoice_service.add_soap_response(
|
|
|
|
|
'readInvoices', get_xml_file('R_read_invoices.xml'), request_check=request_check
|
|
|
|
|
)
|
|
|
|
|
url = get_endpoint('regie/104/invoices')
|
|
|
|
|
url = get_endpoint('regie/102/invoices')
|
|
|
|
|
|
|
|
|
|
freezer.move_to('2023-03-03 18:00:00')
|
|
|
|
|
resp = app.get(url + '?family_id=1312')
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
assert len([x for x in caplog.records if 'Ajout de <Invoice "104/' in x.message]) == 2
|
|
|
|
|
assert len([x for x in caplog.records if 'Mise à jour de <Invoice "104/' in x.message]) == 0
|
|
|
|
|
assert len([x for x in caplog.records if 'Ajout de <Invoice "102/' in x.message]) == 2
|
|
|
|
|
assert len([x for x in caplog.records if 'Mise à jour de <Invoice "102/' in x.message]) == 0
|
|
|
|
|
assert caplog.records[-1].levelno == logging.INFO
|
|
|
|
|
assert caplog.records[-1].message == 'Ajout de <Invoice "104/30"> sur la famille \'1312\''
|
|
|
|
|
assert caplog.records[-1].message == 'Ajout de <Invoice "102/30"> sur la famille \'1312\''
|
|
|
|
|
|
|
|
|
|
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
|
|
|
|
resp = app.get(url + '?NameID=local')
|
|
|
|
@ -8954,17 +9013,17 @@ def test_invoices(invoice_service, con, app, caplog, freezer):
|
|
|
|
|
'no_online_payment_reason': None,
|
|
|
|
|
'reference_id': '30',
|
|
|
|
|
}
|
|
|
|
|
assert len([x for x in caplog.records if 'Ajout de <Invoice "104/' in x.message]) == 2
|
|
|
|
|
assert len([x for x in caplog.records if 'Mise à jour de <Invoice "104/' in x.message]) == 0
|
|
|
|
|
assert len([x for x in caplog.records if 'Ajout de <Invoice "102/' in x.message]) == 2
|
|
|
|
|
assert len([x for x in caplog.records if 'Mise à jour de <Invoice "102/' in x.message]) == 0
|
|
|
|
|
|
|
|
|
|
# No change
|
|
|
|
|
freezer.move_to('2023-03-03 18:10:00')
|
|
|
|
|
resp = app.get(url + '?NameID=local')
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
assert len([x for x in caplog.records if 'Ajout de <Invoice "104/' in x.message]) == 2
|
|
|
|
|
assert len([x for x in caplog.records if 'Mise à jour de <Invoice "104/' in x.message]) == 0
|
|
|
|
|
assert len([x for x in caplog.records if 'Ajout de <Invoice "102/' in x.message]) == 2
|
|
|
|
|
assert len([x for x in caplog.records if 'Mise à jour de <Invoice "102/' in x.message]) == 0
|
|
|
|
|
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=104, invoice_id=30)
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=102, invoice_id=30)
|
|
|
|
|
assert invoice.created.strftime('%Y-%m-%d %H:%M:%S') == '2023-03-03 18:00:00'
|
|
|
|
|
assert invoice.updated.strftime('%Y-%m-%d %H:%M:%S') == '2023-03-03 18:00:00'
|
|
|
|
|
assert invoice.maelis_data_update_date.strftime('%Y-%m-%d %H:%M:%S') == '2023-03-03 18:00:00'
|
|
|
|
@ -8978,14 +9037,14 @@ def test_invoices(invoice_service, con, app, caplog, freezer):
|
|
|
|
|
freezer.move_to('2023-03-03 18:20:00')
|
|
|
|
|
resp = app.get(url + '?NameID=local')
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
assert len([x for x in caplog.records if 'Ajout de <Invoice "104/' in x.message]) == 2
|
|
|
|
|
assert len([x for x in caplog.records if 'Mise à jour de <Invoice "104/' in x.message]) == 1
|
|
|
|
|
assert len([x for x in caplog.records if 'Ajout de <Invoice "102/' in x.message]) == 2
|
|
|
|
|
assert len([x for x in caplog.records if 'Mise à jour de <Invoice "102/' in x.message]) == 1
|
|
|
|
|
assert (
|
|
|
|
|
caplog.records[-1].message
|
|
|
|
|
== 'Mise à jour de <Invoice "104/30"> sur la famille \'1312\': [\'- "pdfName": "invoice.pdf",\', \'+ "pdfName": null,\']'
|
|
|
|
|
== 'Mise à jour de <Invoice "102/30"> sur la famille \'1312\': [\'- "pdfName": "invoice.pdf",\', \'+ "pdfName": null,\']'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=104, invoice_id=30)
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=102, invoice_id=30)
|
|
|
|
|
assert invoice.created.strftime('%Y-%m-%d %H:%M:%S') == '2023-03-03 18:00:00'
|
|
|
|
|
assert invoice.updated.strftime('%Y-%m-%d %H:%M:%S') == '2023-03-03 18:20:00'
|
|
|
|
|
assert invoice.maelis_data_update_date.strftime('%Y-%m-%d %H:%M:%S') == '2023-03-03 18:20:00'
|
|
|
|
@ -8995,7 +9054,7 @@ def test_invoices(invoice_service, con, app, caplog, freezer):
|
|
|
|
|
@mock.patch('passerelle.utils.Request.get')
|
|
|
|
|
def test_invoices_cache(mocked_get, con, app):
|
|
|
|
|
mocked_get.return_value = INVOICE_SERVICE_WSDL
|
|
|
|
|
url = get_endpoint('regie/104/invoices')
|
|
|
|
|
url = get_endpoint('regie/102/invoices')
|
|
|
|
|
|
|
|
|
|
with mock.patch('passerelle.utils.Request.post') as mocked_post:
|
|
|
|
|
mocked_post.side_effect = ReadTimeout('timeout')
|
|
|
|
@ -9022,7 +9081,7 @@ def test_invoices_cache(mocked_get, con, app):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_invoices_not_linked_error(con, app):
|
|
|
|
|
url = get_endpoint('regie/104/invoices')
|
|
|
|
|
url = get_endpoint('regie/102/invoices')
|
|
|
|
|
resp = app.get(url + '?NameID=local')
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == 'User not linked to family'
|
|
|
|
@ -9040,10 +9099,10 @@ def test_invoices_wrong_referential_key_error(con, app):
|
|
|
|
|
|
|
|
|
|
def test_invoices_unicity(invoice_service, con, app, caplog):
|
|
|
|
|
invoice_service.add_soap_response('readInvoices', get_xml_file('R_read_invoices.xml'))
|
|
|
|
|
url = get_endpoint('regie/104/invoices')
|
|
|
|
|
url = get_endpoint('regie/102/invoices')
|
|
|
|
|
resp = app.get(url + '?family_id=1312')
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
assert con.invoice_set.filter(regie_id=104).count() == 2
|
|
|
|
|
assert con.invoice_set.filter(regie_id=102).count() == 2
|
|
|
|
|
assert con.invoice_set.filter(regie_id=109).count() == 0
|
|
|
|
|
|
|
|
|
|
url = get_endpoint('regie/109/invoices')
|
|
|
|
@ -9051,28 +9110,28 @@ def test_invoices_unicity(invoice_service, con, app, caplog):
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
assert con.invoice_set.filter(regie_id=109).count() == 2
|
|
|
|
|
|
|
|
|
|
url = get_endpoint('regie/104/invoices')
|
|
|
|
|
url = get_endpoint('regie/102/invoices')
|
|
|
|
|
resp = app.get(url + '?family_id=1234')
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
|
|
|
|
|
assert con.invoice_set.filter(regie_id=104).count() == 2
|
|
|
|
|
assert con.invoice_set.filter(regie_id=102).count() == 2
|
|
|
|
|
assert caplog.records[-1].levelno == logging.ERROR
|
|
|
|
|
assert [x.message for x in caplog.records][-2:] == [
|
|
|
|
|
'<Invoice "104/8"> sur la famille \'1234\' existe déjà sur la famille \'1312\'',
|
|
|
|
|
'<Invoice "104/30"> sur la famille \'1234\' existe déjà sur la famille \'1312\'',
|
|
|
|
|
'<Invoice "102/8"> sur la famille \'1234\' existe déjà sur la famille \'1312\'',
|
|
|
|
|
'<Invoice "102/30"> sur la famille \'1234\' existe déjà sur la famille \'1312\'',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_invoices_history(invoice_service, con, app):
|
|
|
|
|
def request_check(request):
|
|
|
|
|
assert request.numDossier == 1312
|
|
|
|
|
assert request.codeRegie == 104
|
|
|
|
|
assert request.codeRegie == 102
|
|
|
|
|
assert request.dateStart == datetime.datetime(1970, 1, 1, 0, 0)
|
|
|
|
|
|
|
|
|
|
invoice_service.add_soap_response(
|
|
|
|
|
'readInvoices', get_xml_file('R_read_invoices.xml'), request_check=request_check
|
|
|
|
|
)
|
|
|
|
|
url = get_endpoint('regie/104/invoices/history')
|
|
|
|
|
url = get_endpoint('regie/102/invoices/history')
|
|
|
|
|
|
|
|
|
|
resp = app.get(url + '?family_id=1312')
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
@ -9104,12 +9163,12 @@ def test_invoices_history(invoice_service, con, app):
|
|
|
|
|
'reference_id': '8',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=104, invoice_id=8)
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=102, invoice_id=8)
|
|
|
|
|
assert invoice.status() == 'notified'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_invoices_history_not_linked_error(con, app):
|
|
|
|
|
url = get_endpoint('regie/104/invoices/history')
|
|
|
|
|
url = get_endpoint('regie/102/invoices/history')
|
|
|
|
|
resp = app.get(url + '?NameID=local')
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == 'User not linked to family'
|
|
|
|
@ -9128,13 +9187,13 @@ def test_invoices_history_wrong_referential_key_error(con, app):
|
|
|
|
|
def test_invoice(invoice_service, con, app):
|
|
|
|
|
def request_check(request):
|
|
|
|
|
assert request.numDossier == 1312
|
|
|
|
|
assert request.codeRegie == 104
|
|
|
|
|
assert request.codeRegie == 102
|
|
|
|
|
assert request.dateStart == datetime.datetime(1970, 1, 1, 0, 0)
|
|
|
|
|
|
|
|
|
|
invoice_service.add_soap_response(
|
|
|
|
|
'readInvoices', get_xml_file('R_read_invoices.xml'), request_check=request_check
|
|
|
|
|
)
|
|
|
|
|
url = get_endpoint('regie/104/invoice/1312-8')
|
|
|
|
|
url = get_endpoint('regie/102/invoice/1312-8')
|
|
|
|
|
|
|
|
|
|
resp = app.get(url + '?NameID=ignored')
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
@ -9154,7 +9213,7 @@ def test_invoice_wrong_referential_key_error(con, app):
|
|
|
|
|
|
|
|
|
|
def test_invoice_not_found_invoice(invoice_service, con, app):
|
|
|
|
|
invoice_service.add_soap_response('readInvoices', get_xml_file('R_read_invoices.xml'))
|
|
|
|
|
url = get_endpoint('regie/104/invoice/1-2')
|
|
|
|
|
url = get_endpoint('regie/102/invoice/1-2')
|
|
|
|
|
resp = app.get(url + '?family_id=1312')
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_desc'] == 'Invoice not found'
|
|
|
|
@ -9163,7 +9222,7 @@ def test_invoice_not_found_invoice(invoice_service, con, app):
|
|
|
|
|
def test_pay_invoice(invoice_service, con, app, freezer):
|
|
|
|
|
invoice_service.add_soap_response('readInvoices', get_xml_file('R_read_invoices.xml'))
|
|
|
|
|
|
|
|
|
|
resp = app.get(get_endpoint('regie/104/invoice/1312-30') + '?family_id=1312')
|
|
|
|
|
resp = app.get(get_endpoint('regie/102/invoice/1312-30') + '?family_id=1312')
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
assert resp.json['data']['amount_paid'] == '0'
|
|
|
|
|
assert resp.json['data']['paid'] is False
|
|
|
|
@ -9171,7 +9230,7 @@ def test_pay_invoice(invoice_service, con, app, freezer):
|
|
|
|
|
assert resp.json['data']['online_payment'] is True
|
|
|
|
|
assert resp.json['data']['pay_limit_date'] == '2023-04-30'
|
|
|
|
|
|
|
|
|
|
url = get_endpoint('regie/104/invoice/1312-30/pay/')
|
|
|
|
|
url = get_endpoint('regie/102/invoice/1312-30/pay/')
|
|
|
|
|
data = {
|
|
|
|
|
'transaction_date': '2023-03-03T18:38:00',
|
|
|
|
|
'transaction_id': 'xxx',
|
|
|
|
@ -9180,12 +9239,12 @@ def test_pay_invoice(invoice_service, con, app, freezer):
|
|
|
|
|
freezer.move_to('2023-03-03 18:39:00')
|
|
|
|
|
resp = app.post_json(url + '?NameID=ignored', params=data)
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=104, invoice_id=30)
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=102, invoice_id=30)
|
|
|
|
|
assert invoice.lingo_notification_date.strftime('%Y-%m-%d %H:%M:%S') == '2023-03-03 18:39:00'
|
|
|
|
|
assert invoice.maelis_notification_date is None
|
|
|
|
|
assert invoice.status() == 'paid'
|
|
|
|
|
|
|
|
|
|
resp = app.get(get_endpoint('regie/104/invoice/1312-30') + '?family_id=1312')
|
|
|
|
|
resp = app.get(get_endpoint('regie/102/invoice/1312-30') + '?family_id=1312')
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
assert resp.json['data']['amount_paid'] == '162.3'
|
|
|
|
|
assert resp.json['data']['paid'] is True
|
|
|
|
@ -9201,7 +9260,7 @@ def test_pay_invoice_job(invoice_service, con, app, freezer):
|
|
|
|
|
'numPerson': 261483,
|
|
|
|
|
'lastName': None,
|
|
|
|
|
'firstName': None,
|
|
|
|
|
'codeRegie': 104,
|
|
|
|
|
'codeRegie': 102,
|
|
|
|
|
'amount': 162.3,
|
|
|
|
|
'datePaiement': datetime.datetime(2023, 3, 3, 18, 38),
|
|
|
|
|
'refTransaction': 'xxx',
|
|
|
|
@ -9213,7 +9272,7 @@ def test_pay_invoice_job(invoice_service, con, app, freezer):
|
|
|
|
|
'payInvoices', get_xml_file('R_pay_invoices.xml'), request_check=request_check
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
url = get_endpoint('regie/104/invoice/1312-30/pay/')
|
|
|
|
|
url = get_endpoint('regie/102/invoice/1312-30/pay/')
|
|
|
|
|
data = {
|
|
|
|
|
'transaction_date': '2023-03-03T18:38:00',
|
|
|
|
|
'transaction_id': 'xxx',
|
|
|
|
@ -9222,21 +9281,21 @@ def test_pay_invoice_job(invoice_service, con, app, freezer):
|
|
|
|
|
freezer.move_to('2023-03-03 18:39:00')
|
|
|
|
|
resp = app.post_json(url + '?NameID=ignored', params=data)
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=104, invoice_id=30)
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=102, invoice_id=30)
|
|
|
|
|
assert invoice.lingo_notification_date.strftime('%Y-%m-%d %H:%M:%S') == '2023-03-03 18:39:00'
|
|
|
|
|
assert invoice.maelis_notification_date is None
|
|
|
|
|
assert invoice.maelis_notification_data is None
|
|
|
|
|
assert invoice.status() == 'paid'
|
|
|
|
|
job = Job.objects.get(method_name='notify_invoice_paid_job', natural_id='104/30')
|
|
|
|
|
job = Job.objects.get(method_name='notify_invoice_paid_job', natural_id='102/30')
|
|
|
|
|
assert job.status == 'registered'
|
|
|
|
|
|
|
|
|
|
freezer.move_to('2023-03-03 18:40:00')
|
|
|
|
|
con.jobs()
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=104, invoice_id=30)
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=102, invoice_id=30)
|
|
|
|
|
assert invoice.maelis_notification_date.strftime('%Y-%m-%d %H:%M:%S') == '2023-03-03 18:40:00'
|
|
|
|
|
assert invoice.maelis_notification_data == 4
|
|
|
|
|
assert invoice.status() == 'notified'
|
|
|
|
|
job = Job.objects.get(method_name='notify_invoice_paid_job', natural_id='104/30')
|
|
|
|
|
job = Job.objects.get(method_name='notify_invoice_paid_job', natural_id='102/30')
|
|
|
|
|
assert job.status == 'completed'
|
|
|
|
|
assert job.update_timestamp > job.creation_timestamp
|
|
|
|
|
|
|
|
|
@ -9248,7 +9307,7 @@ def test_pay_invoice_cron(invoice_service, con, app, freezer):
|
|
|
|
|
'numPerson': 261483,
|
|
|
|
|
'lastName': None,
|
|
|
|
|
'firstName': None,
|
|
|
|
|
'codeRegie': 104,
|
|
|
|
|
'codeRegie': 102,
|
|
|
|
|
'amount': 162.3,
|
|
|
|
|
'datePaiement': datetime.datetime(2023, 3, 3, 18, 38),
|
|
|
|
|
'refTransaction': 'xxx',
|
|
|
|
@ -9260,7 +9319,7 @@ def test_pay_invoice_cron(invoice_service, con, app, freezer):
|
|
|
|
|
'payInvoices', get_xml_file('R_pay_invoices.xml'), request_check=request_check
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
url = get_endpoint('regie/104/invoice/1312-30/pay/')
|
|
|
|
|
url = get_endpoint('regie/102/invoice/1312-30/pay/')
|
|
|
|
|
data = {
|
|
|
|
|
'transaction_date': '2023-03-03T18:38:00',
|
|
|
|
|
'transaction_id': 'xxx',
|
|
|
|
@ -9269,7 +9328,7 @@ def test_pay_invoice_cron(invoice_service, con, app, freezer):
|
|
|
|
|
freezer.move_to('2023-03-03 18:39:00')
|
|
|
|
|
resp = app.post_json(url + '?NameID=ignored', params=data)
|
|
|
|
|
assert resp.json['err'] == 0
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=104, invoice_id=30)
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=102, invoice_id=30)
|
|
|
|
|
assert invoice.lingo_notification_date.strftime('%Y-%m-%d %H:%M:%S') == '2023-03-03 18:39:00'
|
|
|
|
|
assert invoice.maelis_notification_date is None
|
|
|
|
|
assert invoice.maelis_notification_data is None
|
|
|
|
@ -9277,14 +9336,14 @@ def test_pay_invoice_cron(invoice_service, con, app, freezer):
|
|
|
|
|
|
|
|
|
|
freezer.move_to('2023-03-03 18:40:00')
|
|
|
|
|
con.notify_invoices_paid()
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=104, invoice_id=30)
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=102, invoice_id=30)
|
|
|
|
|
assert invoice.maelis_notification_date is None
|
|
|
|
|
assert invoice.maelis_notification_data is None
|
|
|
|
|
assert invoice.status() == 'paid'
|
|
|
|
|
|
|
|
|
|
freezer.move_to('2023-03-03 18:55:00')
|
|
|
|
|
con.notify_invoices_paid()
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=104, invoice_id=30)
|
|
|
|
|
invoice = con.invoice_set.get(regie_id=102, invoice_id=30)
|
|
|
|
|
assert invoice.maelis_notification_date.strftime('%Y-%m-%d %H:%M:%S') == '2023-03-03 18:55:00'
|
|
|
|
|
assert invoice.maelis_notification_data == 4
|
|
|
|
|
assert invoice.status() == 'notified'
|
|
|
|
@ -9306,7 +9365,7 @@ def test_pay_invoice_wrong_referential_key_error(con, app):
|
|
|
|
|
|
|
|
|
|
def test_pay_invoice_not_found_invoice(invoice_service, con, app):
|
|
|
|
|
invoice_service.add_soap_response('readInvoices', get_xml_file('R_read_invoices.xml'))
|
|
|
|
|
url = get_endpoint('regie/104/invoice/1-2/pay')
|
|
|
|
|
url = get_endpoint('regie/102/invoice/1-2/pay')
|
|
|
|
|
data = {
|
|
|
|
|
'transaction_date': '2023-03-03T18:38:00',
|
|
|
|
|
'transaction_id': 'xxx',
|
|
|
|
@ -9318,7 +9377,7 @@ def test_pay_invoice_not_found_invoice(invoice_service, con, app):
|
|
|
|
|
|
|
|
|
|
def test_pay_historical_invoice(invoice_service, con, app):
|
|
|
|
|
invoice_service.add_soap_response('readInvoices', get_xml_file('R_read_invoices.xml'))
|
|
|
|
|
url = get_endpoint('regie/104/invoice/1312-8/pay/')
|
|
|
|
|
url = get_endpoint('regie/102/invoice/1312-8/pay/')
|
|
|
|
|
data = {
|
|
|
|
|
'transaction_date': '2023-03-03T18:38:00',
|
|
|
|
|
'transaction_id': 'xxx',
|
|
|
|
@ -9331,13 +9390,13 @@ def test_pay_historical_invoice(invoice_service, con, app):
|
|
|
|
|
|
|
|
|
|
def test_invoice_pdf(invoice_service, con, app):
|
|
|
|
|
def request_check(request):
|
|
|
|
|
assert request.codeRegie == 104
|
|
|
|
|
assert request.codeRegie == 102
|
|
|
|
|
assert request.numInvoice == 8
|
|
|
|
|
|
|
|
|
|
invoice_service.add_soap_response(
|
|
|
|
|
'getInvoicePDF', get_xml_file('R_get_invoice_pdf.xml'), request_check=request_check
|
|
|
|
|
)
|
|
|
|
|
url = get_endpoint('regie/104/invoice/1312-8/pdf')
|
|
|
|
|
url = get_endpoint('regie/102/invoice/1312-8/pdf')
|
|
|
|
|
|
|
|
|
|
resp = app.get(url + '?family_id=1312')
|
|
|
|
|
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
|
|
|
@ -9351,7 +9410,7 @@ def test_invoice_pdf(invoice_service, con, app):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_invoice_pdf_not_linked_error(con, app):
|
|
|
|
|
url = get_endpoint('regie/104/invoice/1312-8/pdf')
|
|
|
|
|
url = get_endpoint('regie/102/invoice/1312-8/pdf')
|
|
|
|
|
resp = app.get(url, status=404)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_class'] == 'django.http.response.Http404'
|
|
|
|
@ -9367,7 +9426,7 @@ def test_invoice_pdf_wrong_referential_key_error(con, app):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_invoice_pdf_wrong_family_id_error(con, app):
|
|
|
|
|
url = get_endpoint('regie/104/invoice/000-8/pdf')
|
|
|
|
|
url = get_endpoint('regie/102/invoice/000-8/pdf')
|
|
|
|
|
resp = app.get(url + '?family_id=1312', status=404)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_class'] == 'django.http.response.Http404'
|
|
|
|
@ -9376,7 +9435,7 @@ def test_invoice_pdf_wrong_family_id_error(con, app):
|
|
|
|
|
|
|
|
|
|
def test_invoice_pdf_error(invoice_service, con, app):
|
|
|
|
|
invoice_service.add_soap_response('getInvoicePDF', get_xml_file('R_get_invoice_pdf_error.xml'))
|
|
|
|
|
url = get_endpoint('regie/104/invoice/1312-8/pdf/')
|
|
|
|
|
url = get_endpoint('regie/102/invoice/1312-8/pdf/')
|
|
|
|
|
resp = app.get(url + '?family_id=1312', status=404)
|
|
|
|
|
assert resp.json['err'] == 1
|
|
|
|
|
assert resp.json['err_class'] == 'django.http.response.Http404'
|
|
|
|
|