MCPcopy
hub / github.com/reflex-dev/reflex / test_initialize_with_admin_dashboard

Function test_initialize_with_admin_dashboard

tests/units/test_app.py:388–402  ·  view source on GitHub ↗

Test setting the admin dashboard of an app. Args: test_model: The default model. mocker: pytest mocker object.

(
    test_model: type[Model], mocker: MockerFixture
)

Source from the content-addressed store, hash-verified

386 reason="starlette_admin not installed or sqlmodel not installed or pydantic not installed",
387)
388def test_initialize_with_admin_dashboard(
389 test_model: type[Model], mocker: MockerFixture
390):
391 """Test setting the admin dashboard of an app.
392
393 Args:
394 test_model: The default model.
395 mocker: pytest mocker object.
396 """
397 conf = rx.Config(app_name="testing", db_url="sqlite:///reflex.db")
398 mocker.patch("reflex_base.config._get_config", return_value=conf)
399 app = App(admin_dash=AdminDash(models=[test_model]))
400 assert app.admin_dash is not None
401 assert len(app.admin_dash.models) > 0
402 assert app.admin_dash.models[0] == test_model
403
404
405@pytest.mark.skipif(

Callers

nothing calls this directly

Calls 2

AppClass · 0.90
AdminDashClass · 0.90

Tested by

no test coverage detected