summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2019-02-08 12:01:15 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2019-02-08 12:20:45 (GMT)
commit23c7bec939f244a3c52cd414711c15cb02eb11d2 (patch)
tree38817d7a36c2f36994f1e56331a67556ed75b999
parentbd10b0b09d3bb4929253d8dad1781be1c23aca34 (diff)
downloadeopayment-23c7bec939f244a3c52cd414711c15cb02eb11d2.zip
eopayment-23c7bec939f244a3c52cd414711c15cb02eb11d2.tar.gz
eopayment-23c7bec939f244a3c52cd414711c15cb02eb11d2.tar.bz2
tipi: prevent whitespaces in refdet (fixes #30485)v1.34
-rw-r--r--eopayment/tipi.py2
-rw-r--r--tests/test_tipi.py2
2 files changed, 1 insertions, 3 deletions
diff --git a/eopayment/tipi.py b/eopayment/tipi.py
index 07fa089..78857a3 100644
--- a/eopayment/tipi.py
+++ b/eopayment/tipi.py
@@ -70,7 +70,7 @@ class Payment(PaymentCommon):
REFDET_RE = re.compile('^[a-zA-Z0-9]{6,30}$')
def _generate_refdet(self):
- return '%s%10d' % (isonow(), random.randint(1, 1000000000))
+ return '%s%010d' % (isonow(), random.randint(1, 1000000000))
def request(self, amount, next_url=None, exer=None, orderid=None,
refdet=None, objet=None, email=None, saisie=None, **kwargs):
diff --git a/tests/test_tipi.py b/tests/test_tipi.py
index c220a5e..31a6792 100644
--- a/tests/test_tipi.py
+++ b/tests/test_tipi.py
@@ -37,7 +37,6 @@ 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(
@@ -76,7 +75,6 @@ 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(