Concerned-Coyotes / summer-code-jam-2020

The repository for the 2020 summer code jam. Find more information at https://pythondiscord.com/pages/code-jams/code-jam-7/
MIT License
0 stars 0 forks source link

Fix error in News tests #49

Closed MushroomMaula closed 4 years ago

MushroomMaula commented 4 years ago

As the random module is used it can happen that the month is February and the day is greater than 28 and leads therefore to the following error

ERROR: test_article_manager_get_latest (news.tests.ArticleTestCase)
Test Article.objects.get_latest
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/summer-code-jam-2020/summer-code-jam-2020/concerned-coyotes/earlyinternet/news/tests.py", line 69, in test_article_manager_get_latest
    published_at=datetime.datetime(year, month, day, hour)
ValueError: day is out of range for month