From 2425dd8f3636360ef9b8364f64a0611429f3e30d Mon Sep 17 00:00:00 2001 From: Lendemor Date: Fri, 4 Oct 2024 21:37:48 +0200 Subject: [PATCH] fix tests --- tests/units/components/core/test_cond.py | 4 ++-- tests/units/test_app.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/units/components/core/test_cond.py b/tests/units/components/core/test_cond.py index f5b6c0895..87b0572cb 100644 --- a/tests/units/components/core/test_cond.py +++ b/tests/units/components/core/test_cond.py @@ -6,7 +6,7 @@ import pytest from reflex.components.base.fragment import Fragment from reflex.components.core.cond import Cond, cond from reflex.components.radix.themes.typography.text import Text -from reflex.state import BaseState, State +from reflex.state import BaseState from reflex.utils.format import format_state_name from reflex.vars.base import LiteralVar, Var, computed_var @@ -124,7 +124,7 @@ def test_cond_no_else(): def test_cond_computed_var(): """Test if cond works with computed vars.""" - class CondStateComputed(State): + class CondStateComputed(BaseState): @computed_var def computed_int(self) -> int: return 0 diff --git a/tests/units/test_app.py b/tests/units/test_app.py index 74f4626a0..31acd53f5 100644 --- a/tests/units/test_app.py +++ b/tests/units/test_app.py @@ -766,6 +766,7 @@ async def test_upload_file(tmp_path, state, delta, token: str, mocker): state._tmp_path = tmp_path # The App state must be the "root" of the state tree app = App() + app._enable_state() app.event_namespace.emit = AsyncMock() # type: ignore current_state = await app.state_manager.get_state(_substate_key(token, state)) data = b"This is binary data"