mirror of
https://github.com/benbusby/whoogle-search
synced 2024-11-10 13:10:30 +00:00
6c429e6dd1
* Add ability to configure site alts w/ env vars Site alternatives (i.e. twitter.com -> nitter.net) can now be configured using environment variables: WHOOGLE_ALT_TW='nitter.net' # twitter alt WHOOGLE_ALT_YT='invidio.us' # youtube alt WHOOGLE_ALT_IG='bibliogram.art/u' # instagram alt Updated testing to confirm results have been modified. * Add site alt vars to docker settings and readme
25 lines
766 B
Python
25 lines
766 B
Python
from app import app
|
|
from app.models.config import Config
|
|
from app.utils.session_utils 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(Config.LANGUAGES)['value'],
|
|
'lang_search': random.choice(Config.LANGUAGES)['value'],
|
|
'ctry': random.choice(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
|