mirror of
https://github.com/benbusby/whoogle-search
synced 2024-11-16 12:13:14 +00:00
d447e5009f
The app/utils/*_utils weren't named very well, and all have been updated to have more accurate names. Function and class documention for the utils have been updated as well, as part of the effort to improve overall documentation for the project.
24 lines
744 B
Python
24 lines
744 B
Python
from app import app
|
|
from app.utils.session import generate_user_keys
|
|
import pytest
|
|
import random
|
|
|
|
demo_config = {
|
|
'near': random.choice(['Seattle', 'New York', 'San Francisco']),
|
|
'dark_mode': str(random.getrandbits(1)),
|
|
'nojs': str(random.getrandbits(1)),
|
|
'lang_interface': random.choice(app.config['LANGUAGES'])['value'],
|
|
'lang_search': random.choice(app.config['LANGUAGES'])['value'],
|
|
'ctry': random.choice(app.config['COUNTRIES'])['value']
|
|
}
|
|
|
|
|
|
@pytest.fixture
|
|
def client():
|
|
with app.test_client() as client:
|
|
with client.session_transaction() as session:
|
|
session['uuid'] = 'test'
|
|
session['fernet_keys'] = generate_user_keys()
|
|
session['config'] = {}
|
|
yield client
|