Skip to content

Commit 4265513

Browse files
authored
Fix enabling parental controls (#796)
1 parent e24fcb4 commit 4265513

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/adguardhome/parental.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ async def enable(self) -> None:
3232
AdGuardHomeError: If enabling parental control failed.
3333
"""
3434
try:
35-
await self.adguard.request(
36-
"parental/enable", method="POST", data="sensitivity=TEEN"
37-
)
35+
await self.adguard.request("parental/enable", method="POST")
3836
except AdGuardHomeError as exception:
3937
raise AdGuardHomeError(
4038
"Enabling AdGuard Home parental control failed"

tests/test_parental.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ async def test_enabled(aresponses):
4141
async def test_enable(aresponses):
4242
"""Test enabling AdGuard Home parental control."""
4343
# Handle to run asserts on request in
44-
async def response_handler(request):
45-
"""Response handler for this test."""
46-
data = await request.text()
47-
assert data == "sensitivity=TEEN"
48-
return aresponses.Response(status=200, text="OK")
49-
5044
aresponses.add(
51-
"example.com:3000", "/control/parental/enable", "POST", response_handler
45+
"example.com:3000",
46+
"/control/parental/enable",
47+
"POST",
48+
aresponses.Response(status=200, text="OK"),
5249
)
5350
aresponses.add(
5451
"example.com:3000",

0 commit comments

Comments
 (0)