Ignore:
Timestamp:
21 Nov 2014, 13:07:57 (10 years ago)
Author:
uli
Message:

Provide a global PayPal? SDK activation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_paypal.py

    r12027 r12029  
    2020import tempfile
    2121import unittest
     22import paypalrestsdk
    2223from zope.component import getGlobalSiteManager, queryUtility
    2324from waeup.ikoba.interfaces import IPayPalConfig
    2425from waeup.ikoba.payments.paypal import (
    2526    get_paypal_config_file_path, parse_paypal_config, get_access_token,
     27    configure_sdk,
    2628    )
    2729from waeup.ikoba.testing import (
     
    7981        assert result['mode'] == "sandbox"
    8082
     83    def test_configure_sdk(self):
     84        # we can configure the paypal sdk
     85        path = os.path.join(self.workdir, 'sample.cfg')
     86        open(path, 'w').write(
     87            "[rest-client]\n"
     88            "id = my-special-id\n"
     89            )
     90        result = configure_sdk(path)
     91        assert result['client_id'] == 'my-special-id'
     92        assert result['client_secret'] is None
     93        assert result['mode'] == "sandbox"
     94        assert paypalrestsdk.api.__api__.mode == 'sandbox'
     95        assert paypalrestsdk.api.__api__.client_id == 'my-special-id'
     96
    8197
    8298class FunctionalPaypalTests(FunctionalTestCase):
Note: See TracChangeset for help on using the changeset viewer.