summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2018-07-25 16:23:02 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2018-07-25 19:10:16 (GMT)
commit3814073d307ca47a7a6797bf700a98869182e33c (patch)
tree453b9530e3220ad225028565c614246e5ed34206
parentfd5651001484eccce9e2a878e84231ab0efd0824 (diff)
downloadeopayment-wip/python3.zip
eopayment-wip/python3.tar.gz
eopayment-wip/python3.tar.bz2
add basic unit test for dummywip/python3
-rw-r--r--eopayment/dummy.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/eopayment/dummy.py b/eopayment/dummy.py
index ef08517..330a618 100644
--- a/eopayment/dummy.py
+++ b/eopayment/dummy.py
@@ -149,21 +149,3 @@ class Payment(PaymentCommon):
def cancel(self, amount, bank_data, **kwargs):
return {}
-
-if __name__ == '__main__':
- options = {
- 'direct_notification_url': 'http://example.com/direct_notification_url',
- 'siret': '1234',
- 'origin': 'Mairie de Perpette-les-oies'
- }
- p = Payment(options)
- retour = 'http://example.com/retour?amount=10.0&direct_notification_url=http%3A%2F%2Fexample.com%2Fdirect_notification_url&email=toto%40example.com&transaction_id=6Tfw2e1bPyYnz7CedZqvdHt7T9XX6T&return_url=http%3A%2F%2Fexample.com%2Fretour&nok=1'
- r = p.response(retour.split('?',1)[1])
- assert not r[0]
- assert r[1] == '6Tfw2e1bPyYnz7CedZqvdHt7T9XX6T'
- assert r[3] is None
- retour = 'http://example.com/retour?amount=10.0&direct_notification_url=http%3A%2F%2Fexample.com%2Fdirect_notification_url&email=toto%40example.com&transaction_id=6Tfw2e1bPyYnz7CedZqvdHt7T9XX6T&return_url=http%3A%2F%2Fexample.com%2Fretour&ok=1&signed=1'
- r = p.response(retour.split('?',1)[1])
- assert r[0]
- assert r[1] == '6Tfw2e1bPyYnz7CedZqvdHt7T9XX6T'
- assert r[3] == 'signature ok'