tests: add non regression test (#30485)
This commit is contained in:
parent
144f227dfc
commit
bd10b0b09d
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue