mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
make sure static subdir 404s correctly
before each request, we put the current service on the flask session, except for with the static folder, cos it's not needed.... except, if we 404, then we return the 404 template, which checks if you're logged in or not to display different nav bar items. This was crashing when current_service wasn't set, so we now set it. also cleaned up some imports and stuff in test files
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import app
|
||||
|
||||
|
||||
def test_crown_logo(app_):
|
||||
with app_.test_request_context():
|
||||
# This image is used by the email templates, so we should be really careful to make
|
||||
# sure that its always there.
|
||||
response = app_.test_client().get('/static/images/email-template/crown-32px.gif')
|
||||
def test_crown_logo(client):
|
||||
# This image is used by the email templates, so we should be really careful to make
|
||||
# sure that its always there.
|
||||
response = client.get('/static/images/email-template/crown-32px.gif')
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_static_404s_return(client):
|
||||
response = client.get('/static/images/some-image-that-doesnt-exist.png')
|
||||
assert response.status_code == 404
|
||||
|
||||
Reference in New Issue
Block a user