Esempio n. 1
0
def test_should_use_correct_enpdoint_url_in_boto(endpoint_url, expected):
    local_aws_ses_client = AwsSesClient()
    local_aws_ses_client.init_app(config.Test.AWS_REGION,
                                  None,
                                  None,
                                  endpoint_url=endpoint_url)
    assert local_aws_ses_client._client._endpoint.host == expected
Esempio n. 2
0
def test_send_email_does_not_use_configuration_set_if_none(mocker):
    local_aws_ses_client = AwsSesClient()
    local_aws_ses_client.init_app(config.Test.AWS_REGION,
                                  mocker.Mock(),
                                  mocker.Mock(),
                                  configuration_set=None)
    boto_mock = mocker.patch.object(local_aws_ses_client,
                                    '_client',
                                    create=True)

    local_aws_ses_client.send_email(FROM_ADDRESS_COM,
                                    to_addresses=FOO_BAR_COM,
                                    subject='Subject',
                                    body='Body')

    assert 'ConfigurationSetName' not in boto_mock.send_raw_email.call_args[1]
Esempio n. 3
0
notify_celery = NotifyCelery()
telstra_sms_client = TelstraSMSClient(
    client_id=os.getenv('TELSTRA_MESSAGING_CLIENT_ID'),
    client_secret=os.getenv('TELSTRA_MESSAGING_CLIENT_SECRET'),
)
twilio_sms_client = TwilioSMSClient(
    account_sid=os.getenv('TWILIO_ACCOUNT_SID'),
    auth_token=os.getenv('TWILIO_AUTH_TOKEN'),
    from_number=os.getenv('TWILIO_FROM_NUMBER'),
)
smtp_client = SMTPClient(
    addr=os.getenv('SMTP_ADDR'),
    user=os.getenv('SMTP_USER'),
    password=os.getenv('SMTP_PASSWORD'),
)
aws_ses_client = AwsSesClient()
encryption = Encryption()
deskpro_client = DeskproClient()
statsd_client = StatsdClient()
redis_store = RedisClient()
performance_platform_client = PerformancePlatformClient()

clients = Clients()

api_user = LocalProxy(lambda: _request_ctx_stack.top.api_user)
authenticated_service = LocalProxy(
    lambda: _request_ctx_stack.top.authenticated_service)


def create_app(application):
    from app.config import configs