增加主题及企微
This commit is contained in:
1 parent
42e29fd747
commit
20271ada61
35 files changed
+2424
-523
No files matched your search
@@ -50,7 +50,8 @@ def test_profile_update_all_fields(client):
|
||||
'department': 'New Dept',
|
||||
'real_name': 'New Name',
|
||||
'phone_number': '1234567890',
|
||||
'language': 'en'
|
||||
'language': 'en',
|
||||
'theme_preference': 'dark',
|
||||
}
|
||||
|
||||
res = client.put('/api/user/profile', headers=headers, json=new_data)
|
||||
@@ -67,6 +68,7 @@ def test_profile_update_all_fields(client):
|
||||
assert data['real_name'] == new_data['real_name']
|
||||
assert data['phone_number'] == new_data['phone_number']
|
||||
assert data['language'] == new_data['language']
|
||||
assert data['theme_preference'] == new_data['theme_preference']
|
||||
|
||||
def test_profile_update_conflict(client):
|
||||
headers1 = get_headers(client, 'test1', 'test1')
|
||||
@@ -81,6 +83,12 @@ def test_profile_update_conflict(client):
|
||||
assert res.status_code == 400
|
||||
assert 'Employee ID already exists' in res.get_json()['error']
|
||||
|
||||
def test_profile_update_theme_preference_validation(client):
|
||||
headers = get_headers(client)
|
||||
res = client.put('/api/user/profile', headers=headers, json={'theme_preference': 'invalid'})
|
||||
assert res.status_code == 400
|
||||
assert 'Invalid theme preference' in res.get_json()['error']
|
||||
|
||||
def test_login_success(client):
|
||||
# Already tested in get_headers, but explicit here
|
||||
res = client.post('/api/user/login', json={'username': 'test1', 'password': 'test1'})
|
||||
|
||||
Reference in new issue
Block a user