summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2018-10-23 18:30:34 (GMT)
committerSerghei Mihai <smihai@entrouvert.com>2018-10-25 14:27:13 (GMT)
commit0e6a724231e501287f8c3593e2691f7e22f06c01 (patch)
treedc7a0324e3a426f28824cef4ec42a94838b0847f /tests
parentd2b5f91e63422dd6f67abda448cdc45f4187b095 (diff)
downloadeopayment-0e6a724231e501287f8c3593e2691f7e22f06c01.zip
eopayment-0e6a724231e501287f8c3593e2691f7e22f06c01.tar.gz
eopayment-0e6a724231e501287f8c3593e2691f7e22f06c01.tar.bz2
paybox: decode correctly responses of validation and cancellation operations (#27543)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_paybox.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_paybox.py b/tests/test_paybox.py
index 6f09be1..ccb0848 100644
--- a/tests/test_paybox.py
+++ b/tests/test_paybox.py
@@ -146,13 +146,13 @@ class PayboxTests(TestCase):
'numero_appel': ['30310733'],
'reference': ['830657461681']
}
- backend_raw_response = """NUMTRANS=0013989865&NUMAPPEL=0030378572&NUMQUESTION=0013989862&SITE=1999888&RANG=32&AUTORISATION=XXXXXX&CODEREPONSE=00000&COMMENTAIRE=Demande traitée avec succès&REFABONNE=&PORTEUR="""
+ backend_raw_response = """NUMTRANS=0013989865&NUMAPPEL=0030378572&NUMQUESTION=0013989862&SITE=1999888&RANG=32&AUTORISATION=XXXXXX&CODEREPONSE=00000&COMMENTAIRE=Demande trait\xe9e avec succ\xe8s&REFABONNE=&PORTEUR="""
backend_expected_response = {"CODEREPONSE": "00000",
"RANG": "32",
"AUTORISATION": "XXXXXX",
"NUMTRANS": "0013989865",
"PORTEUR": "",
- "COMMENTAIRE": "Demande traitée avec succès",
+ "COMMENTAIRE": u"Demande traitée avec succès",
"SITE": "1999888",
"NUMAPPEL": "0030378572",
"REFABONNE": "",
@@ -192,7 +192,7 @@ class PayboxTests(TestCase):
self.assertEqual(requests_post.call_args[0][0], 'https://ppps.paybox.com/PPPS.php')
with mock.patch('eopayment.paybox.requests.post') as requests_post:
- error_response = """CODEREPONSE=00015&COMMENTAIRE=PAYBOX : Transaction non trouvée"""
+ error_response = """CODEREPONSE=00015&COMMENTAIRE=PAYBOX : Transaction non trouv\xe9e"""
response = mock.Mock(status_code=200, content=error_response)
requests_post.return_value = response
self.assertRaisesRegexp(eopayment.ResponseError, 'Transaction non trouvée', getattr(backend, operation_name),