Ejemplo n.º 1
0
def _add_account(context, db):
    test_account = Account(email_address='*****@*****.**',
                           username='******',
                           membership=AccountMembership(
                               type='Monthly Membership',
                               start_date=date.today(),
                               payment_method='Stripe',
                               payment_account_id='foo',
                               payment_id='bar'),
                           agreements=[
                               AccountAgreement(type=PRIVACY_POLICY,
                                                accept_date=date.today())
                           ])
    acct_repository = AccountRepository(db)
    acct_repository.add(test_account, 'foo')
    context.account = acct_repository.get_account_by_email(
        test_account.email_address)
Ejemplo n.º 2
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