def handle(self, *args, **options): fix = options["fix"] accepted, rejected = quotas.resolve_pending_commissions() if accepted: self.stdout.write("Pending accepted commissions:\n %s\n" % list_to_string(accepted)) if rejected: self.stdout.write("Pending rejected commissions:\n %s\n" % list_to_string(rejected)) if fix and (accepted or rejected): self.stdout.write("Fixing pending commissions..\n") quotas.reconcile_resolve_commissions(accept=accepted, reject=rejected, strict=False)
def handle(self, *args, **options): fix = options['fix'] accepted, rejected = quotas.resolve_pending_commissions() if accepted: self.stdout.write("Pending accepted commissions:\n %s\n" % list_to_string(accepted)) if rejected: self.stdout.write("Pending rejected commissions:\n %s\n" % list_to_string(rejected)) if fix and (accepted or rejected): self.stdout.write("Fixing pending commissions..\n") quotas.reconcile_resolve_commissions(accept=accepted, reject=rejected, strict=False)
def test_1(self, qh): qh.return_value = [21, 25, 28] pending = quotas.resolve_pending_commissions() self.assertEqual(pending, ([25], [28, 21]))
def test_no_pending(self, qh): qh.return_value = [] pending = quotas.resolve_pending_commissions() self.assertEqual(pending, ([], []))