Пример #1
0
    def setUpVCR(cls):
        """Set up VCR.

        We use the VCR library to freeze API calls. Frozen calls are stored in
        tests/fixtures/ for your convenience (otherwise your first test run
        would take fooooorrr eeeevvveeerrrr). If you find that an API call has
        drifted from our frozen version of it, simply remove that fixture file
        and rerun. The VCR library should recreate the fixture with the new
        information, and you can commit that with your updated tests.

        """
        cls.vcr_cassette = use_cassette(cls.__name__)
        cls.vcr_cassette.__enter__()
Пример #2
0
    def setUpVCR(cls):
        """Set up VCR.

        We use the VCR library to freeze API calls. Frozen calls are stored in
        tests/fixtures/ for your convenience (otherwise your first test run
        would take fooooorrr eeeevvveeerrrr). If you find that an API call has
        drifted from our frozen version of it, simply remove that fixture file
        and rerun. The VCR library should recreate the fixture with the new
        information, and you can commit that with your updated tests.

        """
        cls.vcr_cassette = use_cassette(cls.__name__)
        cls.vcr_cassette.__enter__()
Пример #3
0
    cr.Currency = 'EUR'
    cr.CardType = 'CB_VISA_MASTERCARD'
    cr.save()
    data = dict(
        accessKeyRef=cr.AccessKey,
        cardNumber='3569990000000132',
        cardExpirationDate='1234',
        cardCvx='123',
        data=cr.PreregistrationData,
    )
    cr.RegistrationData = requests.post(cr.CardRegistrationURL, data).text
    cr.save()
    return cr


with use_cassette('MangopayOAuth'):
    import mangopay
    mangopay.get_default_handler().auth_manager.get_token()


with use_cassette('MangopayHarness'):
    cls = MangopayHarness

    cls.david_id = make_mangopay_account('David')
    cls.david_wallet_id = make_wallet(cls.david_id).Id

    cls.janet_id = make_mangopay_account('Janet')
    cls.janet_wallet_id = make_wallet(cls.janet_id).Id
    cr = create_card(cls.janet_id)
    cls.card_id = cr.CardId
    del cr
Пример #4
0
    account.CountryOfResidence = 'BE'
    account.Nationality = 'BE'
    account.Birthday = 0
    account.Email = '*****@*****.**'
    return mangoapi.users.Create(account).Id


def make_wallet(mangopay_user_id):
    w = Wallet()
    w.Owners.append(mangopay_user_id)
    w.Description = 'test wallet'
    w.Currency = 'EUR'
    return mangoapi.wallets.Create(w)


with use_cassette('MangopayHarness'):
    cls = MangopayHarness

    cls.david_id = make_mangopay_account('David')
    cls.david_wallet_id = make_wallet(cls.david_id).Id

    cls.janet_id = make_mangopay_account('Janet')
    cls.janet_wallet_id = make_wallet(cls.janet_id).Id
    cr = CardRegistration()
    cr.UserId = cls.janet_id
    cr.Currency = 'EUR'
    cr.CardType = 'CB_VISA_MASTERCARD'
    cr = mangoapi.cardRegistrations.Create(cr)
    data = dict(
        accessKeyRef=cr.AccessKey,
        cardNumber='3569990000000132',
Пример #5
0
    account.CountryOfResidence = "BE"
    account.Nationality = "BE"
    account.Birthday = 0
    account.Email = "*****@*****.**"
    return mangoapi.users.Create(account).Id


def make_wallet(mangopay_user_id):
    w = Wallet()
    w.Owners.append(mangopay_user_id)
    w.Description = "test wallet"
    w.Currency = "EUR"
    return mangoapi.wallets.Create(w)


with use_cassette("MangopayHarness"):
    cls = MangopayHarness

    cls.david_id = make_mangopay_account("David")
    cls.david_wallet_id = make_wallet(cls.david_id).Id

    cls.janet_id = make_mangopay_account("Janet")
    cls.janet_wallet_id = make_wallet(cls.janet_id).Id
    cr = CardRegistration()
    cr.UserId = cls.janet_id
    cr.Currency = "EUR"
    cr.CardType = "CB_VISA_MASTERCARD"
    cr = mangoapi.cardRegistrations.Create(cr)
    data = dict(
        accessKeyRef=cr.AccessKey,
        cardNumber="3569990000000132",
Пример #6
0
    account.CountryOfResidence = 'BE'
    account.Nationality = 'BE'
    account.Birthday = 0
    account.Email = '*****@*****.**'
    return mangoapi.users.Create(account).Id


def make_wallet(mangopay_user_id):
    w = Wallet()
    w.Owners.append(mangopay_user_id)
    w.Description = 'test wallet'
    w.Currency = 'EUR'
    return mangoapi.wallets.Create(w)


with use_cassette('MangopayHarness'):
    cls = MangopayHarness

    cls.david_id = make_mangopay_account('David')
    cls.david_wallet_id = make_wallet(cls.david_id).Id

    cls.janet_id = make_mangopay_account('Janet')
    cls.janet_wallet_id = make_wallet(cls.janet_id).Id
    cr = CardRegistration()
    cr.UserId = cls.janet_id
    cr.Currency = 'EUR'
    cr.CardType = 'CB_VISA_MASTERCARD'
    cr = mangoapi.cardRegistrations.Create(cr)
    data = dict(
        accessKeyRef=cr.AccessKey,
        cardNumber='3569990000000132',
Пример #7
0
    cr.Currency = 'EUR'
    cr.CardType = 'CB_VISA_MASTERCARD'
    cr.save()
    data = dict(
        accessKeyRef=cr.AccessKey,
        cardNumber='3569990000000132',
        cardExpirationDate='1234',
        cardCvx='123',
        data=cr.PreregistrationData,
    )
    cr.RegistrationData = requests.post(cr.CardRegistrationURL, data).text
    cr.save()
    return cr


with use_cassette('MangopayOAuth'):
    import mangopay
    mangopay.get_default_handler().auth_manager.get_token()


with use_cassette('MangopayHarness'):
    cls = MangopayHarness

    cls.david_id = make_mangopay_account('David')
    cls.david_wallet_id = make_wallet(cls.david_id).Id

    cls.janet_id = make_mangopay_account('Janet')
    cls.janet_wallet_id = make_wallet(cls.janet_id).Id
    cr = create_card(cls.janet_id)
    cls.card_id = cr.CardId
    del cr