def test_api_user_delete_non_admin():
    """Can a user delete /api/v1/users/<user_id> if not admin"""
    app = create_ctfd()
    with app.app_context():
        register_user(app)
        with app.test_client() as client:
            r = client.delete("/api/v1/teams/2", json="")
            assert r.status_code == 403
    destroy_ctfd(app)
Can a user delete /api/v1/users/<user_id> if not admin
tests/api/v1/test_users.py