summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2020-09-10 09:28:43 (GMT)
committerSerghei Mihai <smihai@entrouvert.com>2020-09-10 14:00:33 (GMT)
commit24459e80d0d25a75ec78fbbcfe6758b5399ba768 (patch)
treeb3076f4ac02ccabe90bf17c6b98002fc9d412ef9
parent5991c69c4e88cd77615593cc28ae353e57fe1a78 (diff)
downloadeopayment-24459e80d0d25a75ec78fbbcfe6758b5399ba768.zip
eopayment-24459e80d0d25a75ec78fbbcfe6758b5399ba768.tar.gz
eopayment-24459e80d0d25a75ec78fbbcfe6758b5399ba768.tar.bz2
misc: do not force to text boolean parameters (#46520)v1.54
-rw-r--r--eopayment/__init__.py5
-rw-r--r--tests/test_paybox.py2
-rw-r--r--tests/test_systempayv2.py4
3 files changed, 8 insertions, 3 deletions
diff --git a/eopayment/__init__.py b/eopayment/__init__.py
index 245c5e2..aab050f 100644
--- a/eopayment/__init__.py
+++ b/eopayment/__init__.py
@@ -164,8 +164,9 @@ class Payment(object):
kwargs['capture_day'] = capture_day
for param in kwargs:
- # encode all input params to unicode
- kwargs[param] = force_text(kwargs[param])
+ # encode all but bool input params to unicode
+ if not isinstance(kwargs[param], bool):
+ kwargs[param] = force_text(kwargs[param])
return self.backend.request(amount, **kwargs)
def response(self, query_string, **kwargs):
diff --git a/tests/test_paybox.py b/tests/test_paybox.py
index 577825e..c251322 100644
--- a/tests/test_paybox.py
+++ b/tests/test_paybox.py
@@ -85,7 +85,7 @@ class PayboxTests(TestCase):
amount = '19.99'
transaction_id, kind, what = backend.request(
Decimal(amount), email=email, orderid=order_id,
- transaction_id=transaction, time=time)
+ transaction_id=transaction, time=time, manual_validation=False)
self.assertEqual(kind, eopayment.FORM)
self.assertEqual(transaction_id, '1234')
root = ET.fromstring(str(what))
diff --git a/tests/test_systempayv2.py b/tests/test_systempayv2.py
index 6dcb29f..240f936 100644
--- a/tests/test_systempayv2.py
+++ b/tests/test_systempayv2.py
@@ -143,3 +143,7 @@ def test_manual_validation():
data['manual_validation'] = True
transaction_id, f, form = backend.request(**data.copy())
assert get_field(form, 'vads_validation_mode')['value'] == '1'
+
+ data['manual_validation'] = False
+ transaction_id, f, form = backend.request(**data.copy())
+ assert get_field(form, 'vads_validation_mode')['value'] == ''