def test_api_tag_patch_admin():
    """Can a user patch /api/v1/tags/<tag_id> if admin"""
    app = create_ctfd()
    with app.app_context():
        gen_challenge(app.db)
        gen_tag(app.db, 1)
        with login_as_user(app, "admin") as client:
            r = client.patch(
                "/api/v1/tags/1", json={"value": "tag_edit", "challenge_id": 1}
            )
            assert r.status_code == 200
            assert r.get_json()["data"]["value"] == "tag_edit"
    destroy_ctfd(app)
Can a user patch /api/v1/tags/<tag_id> if admin
tests/api/v1/test_tags.py