mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-22 00:04:01 +02:00
test: Introducing first unit tests of new Company and News model
This commit is contained in:
23
tests/models/news_test.py
Normal file
23
tests/models/news_test.py
Normal 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,
|
||||
}
|
Reference in New Issue
Block a user