From 0476a426aa4c3c1d83f2ecc71c31ad369723c0a7 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Thu, 28 Oct 2021 12:37:11 -0600 Subject: [PATCH] Add test for ! bang searches --- test/test_routes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test_routes.py b/test/test_routes.py index efd1c58..4aaaf68 100644 --- a/test/test_routes.py +++ b/test/test_routes.py @@ -36,6 +36,11 @@ def test_ddg_bang(client): assert rv._status_code == 302 assert rv.headers.get('Location').startswith('https://www.reddit.com') + # Move '!' to end of the bang + rv = client.get('/search?q=gitlab%20w!') + assert rv._status_code == 302 + assert rv.headers.get('Location').startswith('https://en.wikipedia.org') + # Ensure bang is case insensitive rv = client.get('/search?q=!GH%20whoogle') assert rv._status_code == 302