def test_save_state(): doc = DocumentWithTurnedOnStateManagement( num_1=1, num_2=2, internal=InternalDoc(num=1, string="s") ) assert doc.get_saved_state() is None doc._save_state() assert doc.get_saved_state() == { "num_1": 1, "num_2": 2, "internal": {"num": 1, "string": "s", "lst": [1, 2, 3, 4, 5]}, }
def test_save_state(): doc = DocumentWithTurnedOnStateManagement(num_1=1, num_2=2) assert doc.get_saved_state() is None doc._save_state() assert doc.get_saved_state() == {"num_1": 1, "num_2": 2}