Add context to login flow (#15914)

* Add context to login flow

* source -> context

* Fix unit test

* Update comment
This commit is contained in:
Jason Hu 2018-08-13 02:27:18 -07:00 committed by Paulus Schoutsen
parent 45f12dd3c7
commit 50daef9a52
15 changed files with 36 additions and 38 deletions

View file

@ -109,7 +109,8 @@ async def test_user_init_trumps_discovery(hass, flow_conf):
assert result['type'] == data_entry_flow.RESULT_TYPE_FORM
# User starts flow
result = await hass.config_entries.flow.async_init('test', data={})
result = await hass.config_entries.flow.async_init(
'test', context={'source': config_entries.SOURCE_USER}, data={})
assert result['type'] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
# Discovery flow has been aborted