2020-04-16 02:41:53 +03:00
|
|
|
from app import app
|
2020-12-06 01:01:21 +03:00
|
|
|
from app.models.config import Config
|
2020-07-26 20:53:59 +03:00
|
|
|
from app.utils.session_utils import generate_user_keys
|
2020-04-16 02:41:53 +03:00
|
|
|
import pytest
|
2020-12-06 01:01:21 +03:00
|
|
|
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']
|
|
|
|
}
|
2020-04-16 02:41:53 +03:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def client():
|
2020-06-06 01:09:04 +03:00
|
|
|
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
|