30 lines
723 B
Python
30 lines
723 B
Python
import pytest
|
|
|
|
from myfasthtml.core.instances import SingleInstance, InstancesManager
|
|
|
|
|
|
class RootInstanceForTests(SingleInstance):
|
|
def __init__(self, session):
|
|
super().__init__(None, session, _id="TestRoot")
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def session():
|
|
return {
|
|
"user_info": {
|
|
'email': 'test@myfasthtml.com',
|
|
'username': 'test_user',
|
|
'roles': ['admin'],
|
|
'user_settings': {},
|
|
'id': 'test_user_id',
|
|
'created_at': '2025-11-10T15:52:59.006213',
|
|
'updated_at': '2025-11-10T15:52:59.006213'
|
|
}
|
|
}
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def root_instance(session):
|
|
InstancesManager.reset()
|
|
return RootInstanceForTests(session=session)
|