コード例 #1
0
def test_check_email_with_fake_password(app):
    with app.test_request_context():
        if not app.config.get('ENABLE_EMAIL', False):
            return

        app.config['EMAIL_PASSWORD'] = '******'
        try:
            check_email(app.config)
        except AssertionError:
            pass
コード例 #2
0
def test_check_email_with_fake_account(app):
    with app.test_request_context():
        if not app.config.get('ENABLE_EMAIL', False):
            return

        app.config['EMAIL_USERNAME'] = '******'
        app.config['EMAIL_PASSWORD'] = '******'
        app.config['FROM_ADDR'] = '*****@*****.**'
        app.config['TO_ADDRS'] = ['*****@*****.**']
        try:
            check_email(app.config)
        except AssertionError:
            pass
コード例 #3
0
ファイル: test_a_factory.py プロジェクト: my8100/public-test
def test_check_email_with_fake_account(app):
    with app.test_request_context():
        if not app.config.get('EMAIL_PASSWORD', ''):
            return

        app.config['EMAIL_USERNAME'] = '******'
        app.config['EMAIL_PASSWORD'] = '******'
        app.config['EMAIL_SENDER'] = '*****@*****.**'
        app.config['EMAIL_RECIPIENTS'] = ['*****@*****.**']
        try:
            check_email(app.config)
        except AssertionError:
            pass
コード例 #4
0
def test_check_email_with_ssl_false(app):
    with app.test_request_context():
        if not app.config.get('ENABLE_EMAIL', False) or not app.config.get('SMTP_SERVER_'):
            return

        app.config['SMTP_SERVER'] = app.config['SMTP_SERVER_']
        app.config['SMTP_PORT'] = app.config['SMTP_PORT_']
        app.config['SMTP_OVER_SSL'] = app.config['SMTP_OVER_SSL_']
        app.config['SMTP_CONNECTION_TIMEOUT_'] = app.config['SMTP_CONNECTION_TIMEOUT_']
        app.config['FROM_ADDR'] = app.config['FROM_ADDR_']
        app.config['EMAIL_PASSWORD'] = app.config['EMAIL_PASSWORD_']
        app.config['TO_ADDRS'] = app.config['TO_ADDRS_']

        check_email(app.config)
コード例 #5
0
ファイル: test_a_factory.py プロジェクト: my8100/public-test
def test_check_email_with_ssl_false(app):
    with app.test_request_context():
        if not app.config.get('EMAIL_PASSWORD',
                              '') or not app.config.get('EMAIL_PASSWORD_'):
            return

        app.config['EMAIL_USERNAME'] = app.config['EMAIL_USERNAME_']
        app.config['EMAIL_PASSWORD'] = app.config['EMAIL_PASSWORD_']
        app.config['EMAIL_SENDER'] = app.config['EMAIL_SENDER_']
        app.config['EMAIL_RECIPIENTS'] = app.config['EMAIL_RECIPIENTS_']
        app.config['SMTP_SERVER'] = app.config['SMTP_SERVER_']
        app.config['SMTP_PORT'] = app.config['SMTP_PORT_']
        app.config['SMTP_OVER_SSL'] = app.config['SMTP_OVER_SSL_']
        app.config['SMTP_CONNECTION_TIMEOUT_'] = app.config[
            'SMTP_CONNECTION_TIMEOUT_']

        check_email(app.config)