

def test_objects_for_push_notification(self):
    import recurly
    objs = recurly.objects_for_push_notification('<?xml version="1.0" encoding="UTF-8"?>\n        <new_subscription_notification>\n          <account>\n            <account_code>verena@test.com</account_code>\n            <username>verena</username>\n            <email>verena@test.com</email>\n            <first_name>Verena</first_name>\n            <last_name>Test</last_name>\n            <company_name>Company, Inc.</company_name>\n          </account>\n          <subscription>\n            <plan>\n              <plan_code>bronze</plan_code>\n              <name>Bronze Plan</name>\n              <version type="integer">2</version>\n            </plan>\n            <state>active</state>\n            <quantity type="integer">2</quantity>\n            <unit_amount_in_cents type="integer">2000</unit_amount_in_cents>\n            <activated_at type="datetime">2009-11-22T13:10:38-08:00</activated_at>\n            <canceled_at type="datetime"></canceled_at>\n            <expires_at type="datetime"></expires_at>\n            <current_period_started_at type="datetime">2009-11-22T13:10:38-08:00</current_period_started_at>\n            <current_period_ends_at type="datetime">2009-11-29T13:10:38-08:00</current_period_ends_at>\n            <trial_started_at type="datetime">2009-11-22T13:10:38-08:00</trial_started_at>\n            <trial_ends_at type="datetime">2009-11-29T13:10:38-08:00</trial_ends_at>\n          </subscription>\n        </new_subscription_notification>')
    self.assertEqual(objs['type'], 'new_subscription_notification')
    self.assertTrue(('account' in objs))
    self.assertTrue(isinstance(objs['account'], recurly.Account))
    self.assertEqual(objs['account'].username, 'verena')
    objs.assertTrue(('subscription' in objs))
    self.assertTrue(isinstance(objs['subscription'], recurly.Subscription))
    self.assertEqual(objs['subscription'].state, 'active')

dataset/ETHPy150Open recurly/recurly-client-python/tests/test_recurly.py TestRecurly.test_objects_for_push_notification/VarMisuse@76/557 `self`->`objs`