mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-24 02:39:20 -05:00
small fixes
This commit is contained in:
@@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="1" time="25.056" timestamp="2024-08-24T09:17:04.424827" hostname="vabene-pc"><testcase classname="cookbook.tests.api.test_api_space" name="test_list_multiple" time="24.455" /></testsuite></testsuites>
|
||||
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="1" time="32.909" timestamp="2025-04-10T17:28:33.096783" hostname="DESKTOP-RM10LP5"><testcase classname="cookbook.tests.api.test_api_user" name="test_user_update" time="23.032" /></testsuite></testsuites>
|
||||
File diff suppressed because one or more lines are too long
@@ -110,3 +110,19 @@ def test_user_update(u1_s1, u2_s1, u1_s2):
|
||||
content_type='application/json'
|
||||
)
|
||||
assert r.status_code == 404
|
||||
|
||||
# test can't update any read only fields (superuser/staff/active/...)
|
||||
user = auth.get_user(u1_s1)
|
||||
r = u1_s1.patch(
|
||||
reverse(
|
||||
DETAIL_URL,
|
||||
args={auth.get_user(u1_s1).id}
|
||||
),
|
||||
{'first_name': 'test'},
|
||||
content_type='application/json'
|
||||
)
|
||||
response = json.loads(r.content)
|
||||
assert r.status_code == 200
|
||||
assert response['is_staff'] == user.is_staff
|
||||
assert response['is_superuser'] == user.is_superuser
|
||||
assert response['is_active'] == user.is_active
|
||||
|
||||
Reference in New Issue
Block a user