Skip to content

Commit

Permalink
Fix update_template_universal_login (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjmcgrath authored May 25, 2023
2 parents 38f65c2 + 6f20475 commit 53c326a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
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

0 comments on commit 53c326a

Please sign in to comment.