Skip to content

Commit

Permalink
Update test_queries.py
Browse files Browse the repository at this point in the history
  • Loading branch information
johausmann authored Oct 27, 2023
1 parent fc568f2 commit 28c45c5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion covigator/tests/unit_tests/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,13 @@ def test_get_news(self):
news = self.queries.get_top_news()
self.assertGreater(news.shape[0], 0)
self.assertTrue(news.message_text.loc[0] == "bla")
self.assertTrue(news.message_type.loc[0] == NewsType.RELEASE.name)
self.assertTrue(news.message_type.loc[0] == "RELEASE")
# Add some more news to check that n News are returned
test_news_section = \
[NewsSection(message_text="bla2", message_type=NewsType.RELEASE.name),
NewsSection(message_text="bla3", message_type=NewsType.RELEASE.name),
NewsSection(message_text="bla4", message_type=NewsType.RELEASE.name)]
self.session.add_all(test_news_section)
news = self.queries.get_top_news()
self.assertEqual(news.shape[0], 0)

0 comments on commit 28c45c5

Please sign in to comment.