Ejemplo n.º 1
0
 def handle(self, *args, **options):
     for i in range(options['amount']):
         if options['mode'] == 'totalrandom':
             rt = RecurringTransactionFactory()
         if options['mode'] == 'membership':
             rt = MembershipfeeFactory()
         if options['mode'] == 'keyholder':
             rt = KeyholderfeeFactory()
         print("Generated RecurringTransaction %s" % rt)
Ejemplo n.º 2
0
def generate_all():
    with transaction.atomic():
        members.tests.fixtures.types.generate_standard_set()
        members.tests.fixtures.tags.generate_standard_set()
        MemberFactory.create_batch(100)
        MembershipApplicationFactory.create_batch(25)

        tokentypes.generate_standard_set()
        accesstypes.generate_standard_set()
        NonMemberTokenFactory.create_batch(10)

        creditor.tests.fixtures.tags.generate_standard_set()
        Membershipfee4all()

        TransactionFactory.build_batch(100)
        MemberNoteFactory.create_batch(50)
        TokenFactory.create_batch(50)
        GrantFactory.create_batch(50)

        for m in Member.objects.filter(
                access_granted__atype=AccessType.objects.get(bit=0)):
            KeyholderfeeFactory(owner=m)
        for t in RecurringTransaction.objects.all():
            ret = t.conditional_add_transaction()
Ejemplo n.º 3
0
def test_monthly_not_in_scope_notstarted():
    now = datetime.datetime.now()
    start, end = month_start_end(now+datetime.timedelta(weeks=10))
    t = KeyholderfeeFactory(start=start, end=end)
    assert not t.in_timescope(now)
Ejemplo n.º 4
0
def test_monthly_in_scope_without_end():
    now = datetime.datetime.now()
    start, end = month_start_end(now-datetime.timedelta(weeks=6))
    end = None
    t = KeyholderfeeFactory(start=start, end=end)
    assert t.in_timescope(now)
Ejemplo n.º 5
0
def test_monthly_not_in_scope_notstarted():
    now = datetime.datetime.now()
    start, end = month_start_end(now + datetime.timedelta(weeks=10))
    t = KeyholderfeeFactory(start=start, end=end)
    assert not t.in_timescope(now)
Ejemplo n.º 6
0
def test_monthly_in_scope_without_end():
    now = datetime.datetime.now()
    start, end = month_start_end(now - datetime.timedelta(weeks=6))
    end = None
    t = KeyholderfeeFactory(start=start, end=end)
    assert t.in_timescope(now)