mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Do not deepcopy section schema when applying suggested values (#141280)
Do not deep copy section schema when appying suggested values
This commit is contained in:
parent
358f78c7cd
commit
e192bfb62e
@ -666,7 +666,7 @@ class FlowHandler(Generic[_FlowContextT, _FlowResultT, _HandlerT]):
|
||||
new_section_key = copy.copy(key)
|
||||
schema[new_section_key] = val
|
||||
val.schema = self.add_suggested_values_to_schema(
|
||||
copy.deepcopy(val.schema), suggested_values[key]
|
||||
val.schema, suggested_values[key]
|
||||
)
|
||||
continue
|
||||
|
||||
|
@ -178,6 +178,10 @@ async def test_form_shows_with_added_suggested_values(manager: MockFlowManager)
|
||||
assert markers[2] == "section_1"
|
||||
section_validator = form["data_schema"].schema["section_1"]
|
||||
assert isinstance(section_validator, data_entry_flow.section)
|
||||
# The section class was not replaced
|
||||
assert section_validator is schema.schema["section_1"]
|
||||
# The section schema was not replaced
|
||||
assert section_validator.schema is schema.schema["section_1"].schema
|
||||
section_markers = list(section_validator.schema.schema)
|
||||
assert len(section_markers) == 1
|
||||
assert section_markers[0] == "full_name"
|
||||
|
Loading…
x
Reference in New Issue
Block a user