Skip to content

Commit 53c326a

Browse files
authored
Fix update_template_universal_login (#495)
2 parents 38f65c2 + 6f20475 commit 53c326a

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

auth0/management/branding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def update_template_universal_login(self, body):
9191

9292
return self.client.put(
9393
self._url("templates", "universal-login"),
94-
body={"template": body},
94+
data={"template": body},
9595
)
9696

9797
def get_default_branding_theme(self):

auth0/test/management/test_branding.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,19 @@ def test_delete_template_universal_login(self, mock_rc):
5959
"https://domain/api/v2/branding/templates/universal-login",
6060
)
6161

62-
@mock.patch("auth0.management.branding.RestClient")
62+
@mock.patch("auth0.rest.requests.put")
6363
def test_update_template_universal_login(self, mock_rc):
64-
api = mock_rc.return_value
65-
api.put.return_value = {}
64+
mock_rc.return_value.status_code = 200
65+
mock_rc.return_value.text = "{}"
6666

6767
branding = Branding(domain="domain", token="jwttoken")
6868
branding.update_template_universal_login({"a": "b", "c": "d"})
6969

70-
api.put.assert_called_with(
70+
mock_rc.assert_called_with(
7171
"https://domain/api/v2/branding/templates/universal-login",
72-
body={"template": {"a": "b", "c": "d"}},
72+
json={"template": {"a": "b", "c": "d"}},
73+
headers=mock.ANY,
74+
timeout=5.0,
7375
)
7476

7577
@mock.patch("auth0.management.branding.RestClient")

0 commit comments

Comments
 (0)