def test_api_topics_get_admin():
    """Can a user get /api/v1/topics if admin"""
    app = create_ctfd()
    with app.app_context():
        gen_challenge(app.db)
        gen_topic(app.db, challenge_id=1)
        gen_topic(app.db, challenge_id=1, value="topic2")
        with login_as_user(app, name="admin") as client:
            r = client.get("/api/v1/topics")
            assert r.status_code == 200
            assert r.get_json() == {
                "success": True,
                "data": [{"id": 1, "value": "topic"}, {"id": 2, "value": "topic2"}],
            }
    destroy_ctfd(app)
Can a user get /api/v1/topics if admin
tests/api/v1/test_topics.py