summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2020-09-18 13:42:52 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2020-09-18 13:42:52 (GMT)
commite2ec0860ccb2fff4fddd7cddaabcb75da831bf64 (patch)
treea7b6300ade33b960f6dfd9d9c9faf9498052c7a4
parentb99c62cfd5b27494e0cc659b4bb851b48fee06d4 (diff)
downloadeopayment-e2ec0860ccb2fff4fddd7cddaabcb75da831bf64.zip
eopayment-e2ec0860ccb2fff4fddd7cddaabcb75da831bf64.tar.gz
eopayment-e2ec0860ccb2fff4fddd7cddaabcb75da831bf64.tar.bz2
dummy: handle subject in request() (#46789)v1.57
-rw-r--r--eopayment/dummy.py4
-rw-r--r--tests/test_dummy.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/eopayment/dummy.py b/eopayment/dummy.py
index 8d63936..7e207bb 100644
--- a/eopayment/dummy.py
+++ b/eopayment/dummy.py
@@ -144,7 +144,7 @@ class Payment(PaymentCommon):
def request(self, amount, name=None, address=None, email=None, phone=None,
orderid=None, info1=None, info2=None, info3=None,
- next_url=None, capture_day=None, **kwargs):
+ next_url=None, capture_day=None, subject=None, **kwargs):
self.logger.debug(
'%s amount %s name %s address %s email %s phone %s'
' next_url %s info1 %s info2 %s info3 %s kwargs: %s',
@@ -174,6 +174,8 @@ class Payment(PaymentCommon):
orderid=orderid, info1=info1, info2=info2, info3=info3))
if capture_day is not None:
query['capture_day'] = str(capture_day)
+ if subject is not None:
+ query['subject'] = subject
for key in list(query.keys()):
if query[key] is None:
del query[key]
diff --git a/tests/test_dummy.py b/tests/test_dummy.py
index df0bb49..e7bfaa1 100644
--- a/tests/test_dummy.py
+++ b/tests/test_dummy.py
@@ -33,7 +33,7 @@ def backend():
def test_request(backend, freezer):
freezer.move_to('2020-01-01 00:00:00+01:00')
- transaction_id, method, raw_url = backend.request('10.10', capture_date=datetime.date(2020, 1, 7))
+ transaction_id, method, raw_url = backend.request('10.10', capture_date=datetime.date(2020, 1, 7), subject='Repas pour 4 personnes')
assert transaction_id
assert method == 1
url = urlparse(raw_url)
@@ -47,6 +47,7 @@ def test_request(backend, freezer):
assert qs['amount'] == '10.10'
assert qs['origin'] == 'Mairie de Perpette-les-oies'
assert qs['capture_day'] == '6'
+ assert qs['subject'] == 'Repas pour 4 personnes'
def test_response(backend):