Use content type json constant (#40312)

This commit is contained in:
springstan 2020-09-23 20:21:55 +02:00 committed by GitHub
parent 9c1eb78a0f
commit 6a7caad8dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 170 additions and 153 deletions

View file

@ -9,7 +9,7 @@ from homeassistant.components.twentemilieu.const import (
CONF_POST_CODE,
DOMAIN,
)
from homeassistant.const import CONF_ID
from homeassistant.const import CONF_ID, CONTENT_TYPE_JSON
from tests.common import MockConfigEntry
@ -51,7 +51,7 @@ async def test_invalid_address(hass, aioclient_mock):
aioclient_mock.post(
"https://twentemilieuapi.ximmio.com/api/FetchAdress",
json={"dataList": []},
headers={"Content-Type": "application/json"},
headers={"Content-Type": CONTENT_TYPE_JSON},
)
flow = config_flow.TwenteMilieuFlowHandler()
@ -72,7 +72,7 @@ async def test_address_already_set_up(hass, aioclient_mock):
aioclient_mock.post(
"https://twentemilieuapi.ximmio.com/api/FetchAdress",
json={"dataList": [{"UniqueId": "12345"}]},
headers={"Content-Type": "application/json"},
headers={"Content-Type": CONTENT_TYPE_JSON},
)
flow = config_flow.TwenteMilieuFlowHandler()
@ -88,7 +88,7 @@ async def test_full_flow_implementation(hass, aioclient_mock):
aioclient_mock.post(
"https://twentemilieuapi.ximmio.com/api/FetchAdress",
json={"dataList": [{"UniqueId": "12345"}]},
headers={"Content-Type": "application/json"},
headers={"Content-Type": CONTENT_TYPE_JSON},
)
flow = config_flow.TwenteMilieuFlowHandler()