def test_json_dumps_with_mutables():
    """Test that json.dumps works with Base vars inside mutable types."""

    class MutableContainsBase(BaseState):
        items: list[Foo] = [Foo()]

    dict_val = MutableContainsBase().dict()
    assert isinstance(dict_val[MutableContainsBase.get_full_name()]["items"][0], Foo)
    val = json_dumps(dict_val)
    f_items = '[{"tags": ["123", "456"]}]'
    f_formatted_router = str(formatted_router).replace("'", '"')
    assert (
        val
        == f'{{"{MutableContainsBase.get_full_name()}": {{"items": {f_items}, "router": {f_formatted_router}}}}}'
    )
Test that json.dumps works with Base vars inside mutable types.
tests/units/test_state.py