Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
name: CI
on: [push]
concurrency:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
name: Python ${{ matrix.python }} tests
strategy:
matrix:
python: [2.7, 3.6, 3.7, 3.8, 3.9]
python: [2.7, 3.7, 3.8, 3.9]
os: [ubuntu-latest]
include:
# Python 3.6 is not included in ubuntu latest (currently 22)
- python: 3.6
os: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup python
Expand Down
1 change: 1 addition & 0 deletions recurly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class Account(Resource):
'has_paused_subscription',
'has_past_due_invoice',
'preferred_locale',
'preferred_time_zone',
'custom_fields',
'transaction_type',
'dunning_campaign_id',
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/account/child-accounts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Content-Type: application/xml; charset=utf-8
<company_name nil="nil"></company_name>
<vat_number nil="nil"></vat_number>
<preferred_locale nil="nil"></preferred_locale>
<preferred_time_zone nil="nil"></preferred_time_zone>
<address>
<address1 nil="nil"></address1>
<address2 nil="nil"></address2>
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/account/created-with-parent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ Location: https://api.recurly.com/v2/accounts/testmock
</address>
<accept_language nil="nil"></accept_language>
<preferred_locale>en-US</preferred_locale>
<preferred_time_zone nil="nil"></preferred_time_zone>
</account>
2 changes: 2 additions & 0 deletions tests/fixtures/account/created.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Content-Type: application/xml; charset=utf-8
<account>
<account_code>testmock</account_code>
<preferred_locale>en-US</preferred_locale>
<preferred_time_zone>America/Los_Angeles</preferred_time_zone>
<vat_number>444444-UK</vat_number>
</account>

Expand Down Expand Up @@ -43,4 +44,5 @@ Location: https://api.recurly.com/v2/accounts/testmock
<accept_language nil="nil"></accept_language>
<vat_location_enabled type="boolean">true</vat_location_enabled>
<preferred_locale>en-US</preferred_locale>
<preferred_time_zone>America/Los_Angeles</preferred_time_zone>
</account>
1 change: 1 addition & 0 deletions tests/fixtures/billing-info/account-becs-created.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Location: https://api.recurly.com/v2/accounts/binfo-mock-5
<company_name nil="nil"></company_name>
<vat_number nil="nil"></vat_number>
<preferred_locale nil="nil"></preferred_locale>
<preferred_time_zone nil="nil"></preferred_time_zone>
<address>
<address1 nil="nil"></address1>
<address2 nil="nil"></address2>
Expand Down
9 changes: 5 additions & 4 deletions tests/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ def test_account(self):
account = Account(account_code=account_code)
account.vat_number = '444444-UK'
account.preferred_locale = 'en-US'
account.preferred_time_zone = 'America/Los_Angeles'
with self.mock_request('account/created.xml'):
account.save()
self.assertEqual(account._url, urljoin(recurly.base_uri(), 'accounts/%s' % account_code))
Expand Down Expand Up @@ -1286,7 +1287,7 @@ def test_account_entitlements(self):
'https://api.recurly.com/v2/subscriptions/rhind9aehvrt',
'https://api.recurly.com/v2/external_subscriptions/rlhjggnogtc5'
])

def test_invoice_templates(self):
with self.mock_request('invoice_templates/list.xml'):
template = InvoiceTemplate.all()[0]
Expand Down Expand Up @@ -2795,7 +2796,7 @@ def test_list_external_subscriptions(self):

with self.mock_request('external-subscription/list.xml'):
external_subscriptions = ExternalSubscription.all(per_page = 200)

self.assertEqual(len(external_subscriptions), 2)

self.assertEqual(external_subscriptions[0].external_resource.external_object_reference, 'teste')
Expand Down Expand Up @@ -2824,7 +2825,7 @@ def test_get_external_subscription(self):

with self.mock_request('external-subscription/get.xml'):
external_subscription = ExternalSubscription.get('ru2208s6hmf0')

self.assertEqual(external_subscription.external_resource.external_object_reference, 'teste')
self.assertEqual(external_subscription.external_product_reference, None)
self.assertEqual(external_subscription.last_purchased, None)
Expand Down Expand Up @@ -2899,7 +2900,7 @@ def test_get_external_product(self):

with self.mock_request('external-product/get.xml'):
external_product = ExternalProduct.get('ru1u1gms4msk')

self.assertEqual(external_product.plan.plan_code, '5_abril')
self.assertEqual(external_product.plan.name, '5 de abril')
self.assertEqual(external_product.name, 'product_name_teste')
Expand Down