summaryrefslogtreecommitdiffstats
path: root/tests/test_base_payment.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_base_payment.py')
-rw-r--r--tests/test_base_payment.py30
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/test_base_payment.py b/tests/test_base_payment.py
index 7ea551e..bb23959 100644
--- a/tests/test_base_payment.py
+++ b/tests/test_base_payment.py
@@ -14,7 +14,22 @@ def do_mock_backend(monkeypatch):
'parameters': [
{
'name': 'capture_day',
- }
+ },
+ {
+ 'name': 'manual_validation',
+ 'caption': 'Validation manuelle',
+ 'type': bool,
+ 'default': False,
+ 'scope': 'transaction'
+ },
+ {
+ 'name': 'global_param',
+ 'caption': 'Global Param',
+ 'type': bool,
+ 'default': False,
+ 'scope': 'global'
+ },
+
]
}
@@ -64,3 +79,16 @@ def test_paris_timezone(freezer, monkeypatch):
# converted to Europe/Paris it is already 2018-10-03
# so 2018-10-03 for capture_date is invalid
payment.request(amount=12.2, capture_date=capture_date)
+
+
+def test_get_parameters(monkeypatch):
+ _, payment = do_mock_backend(monkeypatch)
+
+ global_parameters = payment.get_parameters()
+ assert len(global_parameters) == 2
+ assert global_parameters[0]['name'] == 'capture_day'
+ assert global_parameters[1]['name'] == 'global_param'
+
+ transaction_parameters = payment.get_parameters(scope='transaction')
+ assert len(transaction_parameters) == 1
+ assert transaction_parameters[0]['name'] == 'manual_validation'