Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion auth0/management/branding.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def update_template_universal_login(self, body):

return self.client.put(
self._url("templates", "universal-login"),
body={"template": body},
data={"template": body},
)

def get_default_branding_theme(self):
Expand Down
12 changes: 7 additions & 5 deletions auth0/test/management/test_branding.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,19 @@ def test_delete_template_universal_login(self, mock_rc):
"https://domain/api/v2/branding/templates/universal-login",
)

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

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

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

@mock.patch("auth0.management.branding.RestClient")
Expand Down