Fix RSS pubDate missing (Closes #164)
Description
This merge request addresses issue #164 (closed) by adding pubDate to individual RSS feed items in the PackagesFeed class. This change ensures that each RSS item has an accurate publication date, resolving the problem where missing pubDate values were being interpreted as the epoch date by some RSS readers.
Changes Made
-
Views Update:
- Added the
item_pubdatemethod to thePackagesFeedclass indebexpo/packages/views.pyto include the publication date for each RSS feed item. - Updated the
item_pubdatemethod to fetch the latest upload date of each package and use it as thepubDate.
- Added the
-
Functional Tests:
- Added a new test
test_feed_item_pubdateintests/functional/packages/test_packages.pyto assert that thepubDateof an RSS item matches the latest upload date of the package.
- Added a new test
-
Unit Tests:
- Added a new test
test_feed_item_pubdateintests/unit/packages/test_packages.pyto verify that thepubDateis correctly formatted and returned.
- Added a new test
Testing
All changes have been tested using tox to ensure they work as expected. The specific new tests added for this feature confirm that the pubDate is now present and correctly formatted in the RSS feed items.
Acknowledgment
I would like to thank @lyknode for calling to my attention in his response to @kathenas that my previous response already contained the necessary pubDate changes, I just needed to remove logging and write tests