feat(UserInfo): Migrate User Info FAB to React (#33620)

This commit is contained in:
Enzo Martellucci
2025-06-03 19:24:22 +02:00
committed by GitHub
parent cacf1e06d6
commit 20519158d2
16 changed files with 727 additions and 9 deletions

View File

@@ -67,6 +67,37 @@ class TestCurrentUserApi(SupersetTestCase):
rv = self.client.get(meUri)
assert 401 == rv.status_code
def test_update_me_success(self):
self.login(ADMIN_USERNAME)
payload = {
"first_name": "UpdatedFirst",
"last_name": "UpdatedLast",
}
rv = self.client.put("/api/v1/me/", json=payload)
assert rv.status_code == 200
data = json.loads(rv.data.decode("utf-8"))
assert data["result"]["first_name"] == "UpdatedFirst"
assert data["result"]["last_name"] == "UpdatedLast"
def test_update_me_unauthenticated(self):
rv = self.client.put("/api/v1/me/", json={"first_name": "Hacker"})
assert rv.status_code == 401
def test_update_me_invalid_payload(self):
self.login(ADMIN_USERNAME)
rv = self.client.put("/api/v1/me/", json={"first_name": 123})
assert rv.status_code == 400
data = json.loads(rv.data.decode("utf-8"))
assert "first_name" in data["message"]
def test_update_me_empty_payload(self):
self.login(ADMIN_USERNAME)
rv = self.client.put("/api/v1/me/", json={})
assert rv.status_code == 400
class TestUserApi(SupersetTestCase):
def test_avatar_with_invalid_user(self):