look for 'live', not 'production'

config['NOTIFY_ENVIRONMENT'] is hardcoded to `'live'` in the Live config
class. The values as seen on the environment which we send real messages
from:

```
>>> json.loads(os.environ['VCAP_APPLICATION'])['space_name']  # what cloudfoundry sets
'production'
>>> os.environ['NOTIFY_ENVIRONMENT']  # we set this from cloudfoundry
'production'
>>> current_app.config['NOTIFY_ENVIRONMENT']  # hardcoded in the Live config
'live'
>>> current_app.config['NOTIFICATION_QUEUE_PREFIX']  # pulled from env var of same name
'live'
>>> current_app.config['ENV']  # this is an unrelated flask variable
'production'
```
This commit is contained in:
Leo Hemsted
2021-04-08 12:17:22 +01:00
parent dea5828d0e
commit 9bd8c0239c
2 changed files with 2 additions and 2 deletions

View File

@@ -122,7 +122,7 @@ def test_send_broadcast_event_creates_zendesk_p1(mocker, notify_api, sample_broa
mocker.patch('app.celery.broadcast_message_tasks.send_broadcast_provider_message')
with set_config(notify_api, 'NOTIFY_ENVIRONMENT', 'production'):
with set_config(notify_api, 'NOTIFY_ENVIRONMENT', 'live'):
send_broadcast_event(event.id)
assert mock_create_ticket.call_count == 1