- Timestamp:
- 24 Nov 2014, 00:03:55 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_paypal.py
r12029 r12043 25 25 from waeup.ikoba.payments.paypal import ( 26 26 get_paypal_config_file_path, parse_paypal_config, get_access_token, 27 configure_sdk, 27 configure_sdk, get_payment, 28 28 ) 29 29 from waeup.ikoba.testing import ( 30 30 FunctionalLayer, FunctionalTestCase, 31 31 ) 32 33 # 34 # PayPal test config 35 # 36 37 EXTERNAL_PAYPAL_TESTS = False 38 39 # 40 # End of PayPal test config 41 # 42 43 44 def external_paypal_test(func): 45 """A decorator that can block test functions. 46 """ 47 if not EXTERNAL_PAYPAL_TESTS: 48 myself = __file__ 49 if myself.endswith('.pyc'): 50 myself = myself[:-2] 51 print "WARNING: external paypal tests are skipped!" 52 print "WARNING: edit %s to enable them." % myself 53 return 54 return func 32 55 33 56 … … 97 120 98 121 class FunctionalPaypalTests(FunctionalTestCase): 99 # XXX: The functional paypal tests are expensive100 122 101 123 layer = FunctionalLayer 102 124 125 @external_paypal_test 103 126 def test_get_access_token(self): 104 127 # we can get an access token 105 128 result = get_access_token() 106 129 assert isinstance(result, unicode) 130 131 @external_paypal_test 132 def test_get_payment(self): 133 # we can construct (paypal-)payment objects 134 payment = get_payment() 135 assert isinstance(payment, paypalrestsdk.Payment) 136 result = payment.create() 137 assert result is True
Note: See TracChangeset for help on using the changeset viewer.