mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Update config
Source the configuration from an environment file, this way it is similar to how the aws environment works
This commit is contained in:
@@ -114,7 +114,7 @@ def test_create_job(notify_api, notify_db, notify_db_session, sample_template):
|
||||
assert resp_json['data']['original_file_name'] == original_file_name
|
||||
|
||||
boto3.setup_default_session(region_name='eu-west-1')
|
||||
q = boto3.resource('sqs').get_queue_by_name(QueueName='notify-jobs-queue')
|
||||
q = boto3.resource('sqs').get_queue_by_name(QueueName=notify_api.config['NOTIFY_JOB_QUEUE'])
|
||||
messages = q.receive_messages()
|
||||
assert len(messages) == 1
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import pytest
|
||||
import mock
|
||||
import os
|
||||
|
||||
import boto3
|
||||
from config import configs
|
||||
import mock
|
||||
import pytest
|
||||
from alembic.command import upgrade
|
||||
from alembic.config import Config
|
||||
from flask.ext.migrate import Migrate, MigrateCommand
|
||||
from flask.ext.script import Manager
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
||||
from app import create_app, db
|
||||
from app import models
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def notify_api(request):
|
||||
app = create_app('test')
|
||||
app = create_app()
|
||||
ctx = app.app_context()
|
||||
ctx.push()
|
||||
|
||||
@@ -59,12 +59,6 @@ def notify_db_session(request):
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def notify_config(notify_api):
|
||||
notify_api.config['NOTIFY_API_ENVIRONMENT'] = 'test'
|
||||
notify_api.config.from_object(configs['test'])
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def os_environ(request):
|
||||
env_patch = mock.patch('os.environ', {})
|
||||
|
||||
Reference in New Issue
Block a user