diff --git a/CHANGELOG b/CHANGELOG index f7631084..9d7dda11 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +## Version 2.2.1 June 6, 2014 +- Added tests for `invoice_description` + ## Version 2.2.0 May 14, 2014 - Added subscription preview: `subscription.preview()` diff --git a/recurly/__init__.py b/recurly/__init__.py index a6792367..d2e53999 100644 --- a/recurly/__init__.py +++ b/recurly/__init__.py @@ -18,7 +18,7 @@ """ -__version__ = '2.2.0' +__version__ = '2.2.1' BASE_URI = 'https://%s.recurly.com/v2/' """The API endpoint to send requests to.""" @@ -279,6 +279,7 @@ class Coupon(Resource): 'discount_percent', 'discount_in_cents', 'redeem_by_date', + 'invoice_description', 'single_use', 'applies_for_months', 'max_redemptions', diff --git a/tests/fixtures/coupon/created.xml b/tests/fixtures/coupon/created.xml index 14d2a68a..9e7a204e 100644 --- a/tests/fixtures/coupon/created.xml +++ b/tests/fixtures/coupon/created.xml @@ -6,12 +6,13 @@ Content-Type: application/xml; charset=utf-8 - couponmock - Nice Coupon - - 1000 - - Nice Description + couponmock + Nice Coupon + + 1000 + + Invoice description + Nice Description  HTTP/1.1 201 Created @@ -24,6 +25,7 @@ Location: https://api.recurly.com/v2/coupons/couponmock Nice Coupon dollars Nice Description + Invoice description false diff --git a/tests/fixtures/coupon/exists.xml b/tests/fixtures/coupon/exists.xml index 6a12aaa7..37ce0efe 100644 --- a/tests/fixtures/coupon/exists.xml +++ b/tests/fixtures/coupon/exists.xml @@ -23,6 +23,7 @@ Content-Type: application/xml; charset=utf-8 1000 + Invoice description diff --git a/tests/fixtures/coupon/plan-coupon-created.xml b/tests/fixtures/coupon/plan-coupon-created.xml index fd224bd3..b30b8e3a 100644 --- a/tests/fixtures/coupon/plan-coupon-created.xml +++ b/tests/fixtures/coupon/plan-coupon-created.xml @@ -11,6 +11,7 @@ Content-Type: application/xml; charset=utf-8 1000 + Invoice description false basicplan @@ -36,6 +37,7 @@ Location: https://api.recurly.com/v2/coupons/plancouponmock 1000 + Invoice description basicplan diff --git a/tests/test_resources.py b/tests/test_resources.py index 36522a4d..d0e33ec7 100644 --- a/tests/test_resources.py +++ b/tests/test_resources.py @@ -372,7 +372,8 @@ def test_coupon(self): coupon_code=coupon_code, name='Nice Coupon', discount_in_cents=Money(1000), - hosted_description="Nice Description" + hosted_description='Nice Description', + invoice_description='Invoice description' ) with self.mock_request('coupon/created.xml'): coupon.save() @@ -384,6 +385,7 @@ def test_coupon(self): same_coupon = Coupon.get(coupon_code) self.assertEqual(same_coupon.coupon_code, coupon_code) self.assertEqual(same_coupon.name, 'Nice Coupon') + self.assertEqual(same_coupon.invoice_description, 'Invoice description') discount = same_coupon.discount_in_cents self.assertEqual(discount['USD'], 1000) self.assertTrue('USD' in discount) @@ -475,6 +477,7 @@ def test_coupon(self): coupon_code='plancoupon%s' % self.test_id, name='Plan Coupon', discount_in_cents=Money(1000), + invoice_description='Invoice description', applies_to_all_plans=False, plan_codes=('basicplan',), )