Skip to content

Commit

Permalink
Fix test cleanup after creating temporary admin user (#13982)
Browse files Browse the repository at this point in the history
This fixes a test failure due to recent bugfix to prevent deletion
of immutable users. The test in question manually edits the
account.bsdusers table to allow testing logic related to case when
root account is disabled, but then uses user.delete to remove the
temporary admin account. The fix is to use datastore plugin to
directly delete the new admin user.
  • Loading branch information
anodos325 authored Jul 5, 2024
1 parent 5a57129 commit d1530a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/api2/test_user_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def admin():
try:
yield admin
finally:
call("user.delete", admin["id"])
call("datastore.delete", "account.bsdusers", admin["id"])
call("etc.generate", "user")


def test_installer_admin_has_local_administrator_privilege(admin):
Expand Down

0 comments on commit d1530a2

Please sign in to comment.