mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 00:33:58 -04:00
Replace uses of client to set request context
Some tests use the `client` fixture but don’t call any of its methods. The reason for doing this is because the test depends on something in the request context. This commit replaces all those instances with `client_request`, which also sets the request context. These tests are the last ones that still use the `client` fixture. By replacing it with `client_request` we will be able to say that no tests should be using the `client` fixture directly.
This commit is contained in:
@@ -3,13 +3,13 @@ import pytest
|
||||
from app.utils import get_logo_cdn_domain, merge_jsonlike
|
||||
|
||||
|
||||
def test_get_cdn_domain_on_localhost(client, mocker):
|
||||
def test_get_cdn_domain_on_localhost(client_request, mocker):
|
||||
mocker.patch.dict('app.current_app.config', values={'ADMIN_BASE_URL': 'http://localhost:6012'})
|
||||
domain = get_logo_cdn_domain()
|
||||
assert domain == 'static-logos.notify.tools'
|
||||
|
||||
|
||||
def test_get_cdn_domain_on_non_localhost(client, mocker):
|
||||
def test_get_cdn_domain_on_non_localhost(client_request, mocker):
|
||||
mocker.patch.dict('app.current_app.config', values={'ADMIN_BASE_URL': 'https://some.admintest.com'})
|
||||
domain = get_logo_cdn_domain()
|
||||
assert domain == 'static-logos.admintest.com'
|
||||
|
||||
Reference in New Issue
Block a user