2020-04-16 02:41:53 +03:00
|
|
|
from app import app
|
2021-04-01 07:23:30 +03:00
|
|
|
from app.utils.session import generate_user_key
|
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)),
|
2020-12-18 00:39:35 +03:00
|
|
|
'lang_interface': random.choice(app.config['LANGUAGES'])['value'],
|
|
|
|
'lang_search': random.choice(app.config['LANGUAGES'])['value'],
|
|
|
|
'ctry': random.choice(app.config['COUNTRIES'])['value']
|
2020-12-06 01:01:21 +03:00
|
|
|
}
|
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'
|
2021-04-01 07:23:30 +03:00
|
|
|
session['key'] = generate_user_key()
|
2020-06-06 01:09:04 +03:00
|
|
|
session['config'] = {}
|
|
|
|
yield client
|