99
1010
1111SAMPLE_OUTPUT = (
12- "- 🆕 **New libraries** — Three new libraries broaden coverage of "
12+ "- **New libraries** — Three new libraries broaden coverage of "
1313 "scientific computing and modern C++ patterns.\n "
14- "- ⚡ **Performance improvements** — Compile-time and runtime gains "
14+ "- **Performance improvements** — Compile-time and runtime gains "
1515 "are reported across multiple core components.\n "
16- "- 🔒 **Security & reliability** — Several stability and correctness "
16+ "- **Security & reliability** — Several stability and correctness "
1717 "fixes land in this release.\n "
1818)
1919
@@ -111,11 +111,10 @@ def test_whats_new_items_parses_bullets(version):
111111
112112 items = version .whats_new_items
113113 assert len (items ) == 3
114- assert items [0 ]["title" ].startswith ("🆕" )
115- assert "New libraries" in items [0 ]["title" ]
114+ assert items [0 ]["title" ] == "New libraries"
116115 assert items [0 ]["description" ].startswith ("Three new libraries" )
117- assert items [1 ]["title" ]. startswith ( "⚡" )
118- assert items [2 ]["title" ]. startswith ( "🔒" )
116+ assert items [1 ]["title" ] == "Performance improvements"
117+ assert items [2 ]["title" ] == "Security & reliability"
119118
120119
121120@pytest .mark .django_db
@@ -129,29 +128,45 @@ def test_whats_new_items_ignores_non_bullet_lines(version):
129128 Version .objects .filter (pk = version .pk ).update (
130129 whats_new = (
131130 "Some preamble that should be ignored.\n "
132- "- 🆕 **New libraries** — One library added.\n "
131+ "- **New libraries** — One library added.\n "
133132 "Trailing line without bullet.\n "
134133 )
135134 )
136135 version .refresh_from_db ()
137136 items = version .whats_new_items
138137 assert len (items ) == 1
139- assert items [0 ]["title" ] == "🆕 New libraries"
138+ assert items [0 ]["title" ] == "New libraries"
140139
141140
142141@pytest .mark .django_db
143- def test_whats_new_items_parses_dashless_colon_format (version ):
144- """Real LLM output sometimes omits the bullet marker and puts the colon
145- inside the bold label — the parser must accept that ."""
142+ def test_whats_new_items_parses_colon_in_label (version ):
143+ """A colon inside the bold label is stripped; the bullet marker is
144+ still required ."""
146145 Version .objects .filter (pk = version .pk ).update (
147146 whats_new = (
148- "📦 **New libraries:** One new library introduces open-method support.\n "
149- "⚡ **Performance improvements:** Container redesigns deliver speed gains.\n "
147+ "- **New libraries:** One new library introduces open-method support.\n "
148+ "* **Performance improvements:** Container redesigns deliver speed gains.\n "
150149 )
151150 )
152151 version .refresh_from_db ()
153152 items = version .whats_new_items
154153 assert len (items ) == 2
155- assert items [0 ]["title" ] == "📦 New libraries"
154+ assert items [0 ]["title" ] == "New libraries"
156155 assert items [0 ]["description" ].startswith ("One new library" )
157- assert items [1 ]["title" ] == "⚡ Performance improvements"
156+ assert items [1 ]["title" ] == "Performance improvements"
157+
158+
159+ @pytest .mark .django_db
160+ def test_whats_new_items_ignores_dashless_lines (version ):
161+ """Lines without a leading bullet marker are not list items and are
162+ skipped."""
163+ Version .objects .filter (pk = version .pk ).update (
164+ whats_new = (
165+ "**New libraries:** This line has no bullet marker.\n "
166+ "- **Performance improvements** — This one does.\n "
167+ )
168+ )
169+ version .refresh_from_db ()
170+ items = version .whats_new_items
171+ assert len (items ) == 1
172+ assert items [0 ]["title" ] == "Performance improvements"
0 commit comments