def test_subscription_active(self): self.braintree_sub.active = False self.braintree_sub.save() Processor(notification(kind=self.kind, subject=self.sub)).process() eq_(self.braintree_sub.reget().active, True)
def test_no_transactions_data(self): process = Processor( notification(subject=subscription(transactions=[]), kind=self.kind)) process.process() eq_(process.transaction, None)
def test_ok(self): Processor(notification(kind=self.kind, subject=self.sub)).process() transaction = Transaction.objects.get() eq_(transaction.status, constants.STATUS_CHECKED) eq_(BraintreeTransaction.objects.get().transaction, transaction) eq_(self.braintree_sub.reget().active, True)
def process(self, subscription): hook = Processor(notification(subject=subscription, kind=self.kind)) hook.process() hook.get_subscription() hook.update_transactions() return hook