

def test_link_customer_customer_deleted(self):
    msg = {
        'created': 1348286560,
        'data': {
            'object': {
                'account_balance': 0,
                'active_card': None,
                'created': 1348286302,
                'delinquent': False,
                'description': None,
                'discount': None,
                'email': 'paltman+test@gmail.com',
                'id': 'cus_xxxxxxxxxxxxxxx',
                'livemode': True,
                'object': 'customer',
                'subscription': None,
            },
        },
        'id': 'evt_xxxxxxxxxxxxx',
        'livemode': True,
        'object': 'event',
        'pending_webhooks': 1,
        'type': 'customer.deleted',
    }
    event = Event.objects.create(stripe_id=msg['id'], kind='customer.deleted', livemode=True, webhook_message=msg, validated_message=msg)
    customers.link_customer(event)
    self.assertEquals(event.customer, self.customer)

dataset/ETHPy150Open pinax/pinax-stripe/pinax/stripe/tests/test_event.py TestEventMethods.test_link_customer_customer_deleted/original