Пример #1
0
def random_transaction():
    value = create_decimal(1000.0 * random.random())
    description = "%s transaction" % value
    transaction = Transaction(value, description)

    assert (transaction.value() == value)
    assert (transaction.description() == description)

    return transaction
Пример #2
0
def random_transaction(account1, account2):
    value = create_decimal(1000.0 * random.random())
    description = "%s transaction" % value
    transaction = Transaction(value, description)

    assert (transaction.value() == value)
    assert (transaction.description() == description)

    assert (account1.get_overdraft_limit() == account1_overdraft_limit)
    assert (account2.get_overdraft_limit() == account2_overdraft_limit)

    if random.randint(0, 1):
        return (transaction, account1, account2)
    else:
        return (transaction, account2, account1)