Exemplo n.º 1
0
def add_account(db, **overrides):
    acct_repository = AccountRepository(db)
    account = build_test_account(**overrides)
    account.id = acct_repository.add(account, 'test_password')
    if account.membership is not None:
        acct_repository.add_membership(account.id, account.membership)

    return account
Exemplo n.º 2
0
def add_account_membership(db, account_id, **overrides):
    membership = build_test_membership(**overrides)
    acct_repository = AccountRepository(db)
    acct_repository.add_membership(account_id, membership)

    return membership