Esempio n. 1
0
 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)
Esempio n. 2
0
 def test_no_transactions_data(self):
     process = Processor(
         notification(subject=subscription(transactions=[]),
                      kind=self.kind))
     process.process()
     eq_(process.transaction, None)
Esempio n. 3
0
 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)
Esempio n. 4
0
 def process(self, subscription):
     hook = Processor(notification(subject=subscription, kind=self.kind))
     hook.process()
     hook.get_subscription()
     hook.update_transactions()
     return hook