Command exited with code 1. Command output: ============================= test session starts ============================== platform linux -- Python 3.12.3, pytest-9.2.0, pluggy-1.7.0 -- /root/telegram-saas/.venv/bin/python3 cachedir: .pytest_cache rootdir: /root/telegram-saas configfile: pyproject.toml plugins: anyio-4.16.0, asyncio-1.5.0 asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function collecting ... collected 1 item tests/integration/test_admin_platform_api.py::test_admin_platform_endpoints_and_superuser_guard FAILED [100%] =================================== FAILURES =================================== ______________ test_admin_platform_endpoints_and_superuser_guard _______________ async_client = db_session = @pytest.mark.asyncio async def test_admin_platform_endpoints_and_superuser_guard( async_client: AsyncClient, db_session: AsyncSession, ): # 1. Create a regular user (non-superuser) reg_email = f"user_{uuid.uuid4().hex[:6]}@example.com" reg_resp = await async_client.post( "/api/v1/auth/register", json={"email": reg_email, "password": "PasswordUser123!", "full_name": "Standard User"}, ) user_token = reg_resp.json()["data"]["access_token"] # 2. Attempt to access superadmin endpoints as regular user -> 403 Forbidden forbidden_resp = await async_client.get( "/api/v1/admin/stats", headers={"Authorization": f"Bearer {user_token}"}, ) assert forbidden_resp.status_code == 403 assert "Superadmin privileges required" in forbidden_resp.json()["detail"] # 3. Create a genuine superuser in DB super_email = f"superuser_{uuid.uuid4().hex[:6]}@example.com" > super_user = User( email=super_email, hashed_password=hash_password("SuperAdmin2026!"), full_name="Platform Superadmin", is_superuser=True, is_active=True, ) tests/integration/test_admin_platform_api.py:32: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ :4: in __init__ return new_state._initialize_instance(self, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .venv/lib/python3.12/site-packages/sqlalchemy/orm/state.py:597: in _initialize_instance with util.safe_reraise(): .venv/lib/python3.12/site-packages/sqlalchemy/util/langhelpers.py:166: in __exit__ raise exc_value.with_traceback(exc_tb) .venv/lib/python3.12/site-packages/sqlalchemy/orm/state.py:595: in _initialize_instance manager.original_init(*mixed[1:], **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = kwargs = {'email': 'superuser_8fc425@example.com', 'hashed_password': '$argon2id$v=19$m=65536,t=3,p=4$quTT3r3WJozOG7MwmSd9Ww$uEAscOHzakdTVOwmSa7Ts5gCTIiryVQ2Tuc9b7UdGkY', 'full_name': 'Platform Superadmin', 'is_superuser': True, ...} def _declarative_constructor(self: Any, **kwargs: Any) -> None: """A simple constructor that allows initialization from kwargs. Sets attributes on the constructed instance using the names and values in ``kwargs``. Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. """ cls_ = type(self) for k in kwargs: if not hasattr(cls_, k): > raise TypeError( "%r is an invalid keyword argument for %s" % (k, cls_.__name__) ) E TypeError: 'hashed_password' is an invalid keyword argument for User .venv/lib/python3.12/site-packages/sqlalchemy/orm/decl_base.py:2361: TypeError ----------------------------- Captured stdout call ----------------------------- 2026-11-19 06:24:42 [info ] dispatching_domain_event event_id=1864905b-e09c-44a9-8df4-dd031220f2df event_type=TenantCreatedEvent handlers_count=1 2026-11-19 06:24:42 [info ] domain_event_recorded event_id=1864905b-e09c-44a9-8df4-dd031220f2df event_type=TenantCreatedEvent tenant_id=5adce0e6-02e0-4e27-9f33-8621bafc4940 user_id=None 2026-11-19 06:24:42 [info ] dispatching_domain_event event_id=1d3ea772-fa6d-448c-9ca2-f54b1ec36464 event_type=UserRegisteredEvent handlers_count=1 2026-11-19 06:24:42 [info ] domain_event_recorded event_id=1d3ea772-fa6d-448c-9ca2-f54b1ec36464 event_type=UserRegisteredEvent tenant_id=None user_id=41230386-e0a8-480d-a359-3bd89a4887dd =========================== short test summary info ============================ FAILED tests/integration/test_admin_platform_api.py::test_admin_platform_endpoints_and_superuser_guard ============================== 1 failed in 3.07s ===============================