test: Introducing first unit tests of new Company and News model

This commit is contained in:
TrisNol
2023-07-11 18:03:23 +02:00
parent 52d7f62bbe
commit 9da3e4adb9
2 changed files with 58 additions and 0 deletions

23
tests/models/news_test.py Normal file
View File

@ -0,0 +1,23 @@
"""Test Models.nes."""
from aki_prj23_transparenzregister.models.news import News
def test_to_dict() -> None:
"""Tests if the version tag is entered."""
news = News(
"4711",
"Economy collapses",
"2042",
"Toilet paper prices rising",
"https://www.google.com",
)
assert news.to_dict() == {
"id": news.id,
"title": news.title,
"date": news.date,
"text": news.text,
"source_url": news.source_url,
}