def test_api_topics_delete_target_admin():
    """Can a user delete /api/v1/topics if admin"""
    app = create_ctfd()
    with app.app_context():
        gen_challenge(app.db)
        gen_topic(app.db, challenge_id=1)
        with login_as_user(app, "admin") as client:
            r = client.delete("/api/v1/topics?type=challenge&target_id=1", json="")
            assert r.status_code == 200
            resp = r.get_json()
            assert resp.get("data") is None
            assert resp.get("success") is True
    destroy_ctfd(app)
Can a user delete /api/v1/topics if admin
tests/api/v1/test_topics.py