summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2019-02-08 11:58:35 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2019-02-08 12:20:45 (GMT)
commitbd10b0b09d3bb4929253d8dad1781be1c23aca34 (patch)
treeb8f6096f49b89a98a4fdfbfed7cb6e14a98275e6
parent144f227dfc377ab99bc6c2d36edcad4741f651b9 (diff)
downloadeopayment-bd10b0b09d3bb4929253d8dad1781be1c23aca34.zip
eopayment-bd10b0b09d3bb4929253d8dad1781be1c23aca34.tar.gz
eopayment-bd10b0b09d3bb4929253d8dad1781be1c23aca34.tar.bz2
tests: add non regression test (#30485)
-rw-r--r--tests/test_tipi.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_tipi.py b/tests/test_tipi.py
index cf30540..c220a5e 100644
--- a/tests/test_tipi.py
+++ b/tests/test_tipi.py
@@ -17,6 +17,7 @@ def test_tipi():
email='info@entrouvert.com',
urlcl='http://example.com/tipi/test',
saisie='T')
+ assert eopayment.tipi.Payment.REFDET_RE.match(payment_id) is not None
parsed_qs = parse_qs(urlparse(url).query)
assert parsed_qs['objet'][0].startswith('tout a fait')
assert parsed_qs['montant'] == ['12312']
@@ -36,6 +37,7 @@ def test_tipi():
p.response('foo=bar')
+@pytest.mark.xfail
def test_tipi_no_orderid_no_refdet():
p = eopayment.Payment('tipi', {'numcli': '12345'})
payment_id, kind, url = p.request(
@@ -43,6 +45,7 @@ def test_tipi_no_orderid_no_refdet():
exer=9999,
email='info@entrouvert.com',
saisie='T')
+ assert eopayment.tipi.Payment.REFDET_RE.match(payment_id) is not None
parsed_qs = parse_qs(urlparse(url).query)
assert 'objet' not in parsed_qs
assert parsed_qs['montant'] == ['12312']
@@ -59,6 +62,7 @@ def test_tipi_orderid_refdef_compatible():
amount=Decimal('123.12'),
email='info@entrouvert.com',
orderid='F121212')
+ assert eopayment.tipi.Payment.REFDET_RE.match(payment_id)
expected_url = urlparse(eopayment.tipi.TIPI_URL)
parsed_url = urlparse(url)
assert parsed_url[:3] == expected_url[:3]
@@ -72,6 +76,7 @@ def test_tipi_orderid_refdef_compatible():
assert parsed_qs['refdet'] == ['F121212']
+@pytest.mark.xfail
def test_tipi_orderid_not_refdef_compatible():
p = eopayment.Payment('tipi', {'numcli': '12345', 'saisie': 'A'})
payment_id, kind, url = p.request(
@@ -79,6 +84,7 @@ def test_tipi_orderid_not_refdef_compatible():
email='info@entrouvert.com',
objet='coucou',
orderid='F12-12-12')
+ assert eopayment.tipi.Payment.REFDET_RE.match(payment_id) is not None
expected_url = urlparse(eopayment.tipi.TIPI_URL)
parsed_url = urlparse(url)
assert parsed_url[:3] == expected_url[:3]