@@ -232,6 +232,33 @@ def test_after(self):
232232 titles = [d ["title" ] for d in data ]
233233 self .assertFalse ("Null Island QGIS Hackfest" in titles )
234234
235+ def test_upcoming_feed_becomes_active (self ):
236+ """Test that entries whose publish_from falls between `after` and now
237+ are included for QGIS >= 3.36, even if their modified date predates `after`.
238+ Regression test for https://github.com/qgis/QGIS-Feed-Website/issues/164
239+ """
240+ c = Client (
241+ HTTP_USER_AGENT = "Mozilla/5.0 QGIS/33600/Fedora "
242+ "Linux (Workstation Edition)"
243+ )
244+ # Simulate an entry that was created in the past, scheduled to publish later,
245+ # but is now active: modified=2025-01-01, publish_from=2025-06-01.
246+ # QGIS last checked on 2025-02-01 (after=2025-02-01).
247+ # modified (2025-01-01) < after (2025-02-01), so the old query would miss it.
248+ # publish_from (2025-06-01) is between after and now, so it must be included.
249+ with connection .cursor () as cursor :
250+ cursor .execute (
251+ "UPDATE qgisfeed_qgisfeedentry "
252+ "SET publish_from='2025-06-01', modified='2025-01-01', "
253+ "publish_to=NULL, published=True "
254+ "WHERE title='QGIS Italian Meeting'"
255+ )
256+ # after = 2025-02-01, before publish_from but after modified
257+ response = c .get ("/?after=%s" % timezone .datetime (2025 , 2 , 1 ).timestamp ())
258+ data = json .loads (response .content )
259+ titles = [d ["title" ] for d in data ]
260+ self .assertIn ("QGIS Italian Meeting" , titles )
261+
235262 def test_invalid_parameters (self ):
236263 c = Client (
237264 HTTP_USER_AGENT = "Mozilla/5.0 QGIS/32400/Fedora "
0 commit comments