- Updated dark theme (#121) - Dark theme is no longer the previous high contrast "white on black" color scheme - New configuration settings - Split interface and result language config (#89) - Added option for using privacy respecting result alternatives (#106) - `youtube.com` -> `invidiou.site` - `twitter.com` -> `nitter.net` - `instagram.com` -> `bibliogram.art` - Improved search suggestion arrow key navigation behavior (#115) - Added repl.it deployment (#114) - Improved ad filtering for non-English results (f7380ae15d
) - Split interface and result language config (#89) - New config option: privacy respecting result alternatives (#106) - Updated search suggestion behavior (#115) - Minor project improvements and refactoring: - Added footer to results UI - Updated opensearch template - Various bug fixes, including: - Fixed pipx run command (#118) - Fixed browser autocomplete (#128) - Fixed missing autofocus on search field in Firefox (dfb1e81fa1
)
34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
from app.utils.session_utils import generate_user_keys, valid_user_session
|
|
|
|
|
|
def test_generate_user_keys():
|
|
keys = generate_user_keys()
|
|
assert 'text_key' in keys
|
|
assert 'element_key' in keys
|
|
assert keys['text_key'] not in keys['element_key']
|
|
|
|
|
|
def test_valid_session(client):
|
|
assert not valid_user_session({'fernet_keys': '', 'config': {}})
|
|
with client.session_transaction() as session:
|
|
assert valid_user_session(session)
|
|
|
|
|
|
def test_request_key_generation(client):
|
|
rv = client.get('/')
|
|
cookie = rv.headers['Set-Cookie']
|
|
|
|
rv = client.get('/search?q=test+1', headers={'Cookie': cookie})
|
|
assert rv._status_code == 200
|
|
|
|
with client.session_transaction() as session:
|
|
assert valid_user_session(session)
|
|
text_key = session['fernet_keys']['text_key']
|
|
|
|
rv = client.get('/search?q=test+2', headers={'Cookie': cookie})
|
|
assert rv._status_code == 200
|
|
|
|
with client.session_transaction() as session:
|
|
assert valid_user_session(session)
|
|
assert text_key not in session['fernet_keys']['text_key']
|