Beispiel #1
0
def add_fake_yahoo_account(db_session, email_address='*****@*****.**'):
    import platform
    from inbox.models.backends.generic import GenericAccount
    from inbox.models import Namespace
    account = GenericAccount(email_address=email_address,
                             sync_host=platform.node(),
                             provider='yahoo')
    account.imap_password = '******'
    account.smtp_password = '******'
    account.namespace = Namespace()
    db_session.add(account)
    db_session.commit()
    return account
Beispiel #2
0
def add_fake_yahoo_account(db_session, email_address='*****@*****.**'):
    import platform
    from inbox.models.backends.generic import GenericAccount
    from inbox.models import Namespace
    account = GenericAccount(email_address=email_address,
                             sync_host=platform.node(),
                             provider='yahoo')
    account.imap_password = '******'
    account.smtp_password = '******'
    account.namespace = Namespace()
    db_session.add(account)
    db_session.commit()
    return account
Beispiel #3
0
def add_generic_imap_account(db_session, email_address='*****@*****.**'):
    import platform
    from inbox.models.backends.generic import GenericAccount
    from inbox.models import Namespace
    account = GenericAccount(email_address=email_address,
                             sync_host=platform.node(),
                             provider='custom')
    account.imap_endpoint = ('imap.custom.com', 993)
    account.smtp_endpoint = ('smtp.custom.com', 587)
    account.imap_password = '******'
    account.smtp_password = '******'
    account.namespace = Namespace()
    db_session.add(account)
    db_session.commit()
    return account
Beispiel #4
0
def add_generic_imap_account(db_session, email_address='*****@*****.**'):
    import platform
    from inbox.models.backends.generic import GenericAccount
    from inbox.models import Namespace
    account = GenericAccount(email_address=email_address,
                             sync_host=platform.node(),
                             provider='custom')
    account.imap_endpoint = ('imap.custom.com', 993)
    account.smtp_endpoint = ('smtp.custom.com', 587)
    account.imap_password = '******'
    account.smtp_password = '******'
    account.namespace = Namespace()
    db_session.add(account)
    db_session.commit()
    return account
def add_account_with_different_namespace_id(db_session,
                                            email_address='*****@*****.**'):
    import platform
    from inbox.models.backends.generic import GenericAccount
    from inbox.models import Namespace
    account = GenericAccount(id=11,
                             email_address=email_address,
                             sync_host=platform.node(),
                             provider='yahoo')
    account.imap_password = '******'
    account.smtp_password = '******'
    account.namespace = Namespace()
    db_session.add(account)
    db_session.commit()
    assert account.namespace.id != account.id
    return account