Reworked the options creation (#464)

Fixed the bug
This commit is contained in:
2023-12-23 21:19:36 +01:00
committed by GitHub
parent c2f6a2d9f6
commit 6ccf2ffd17
3 changed files with 22 additions and 6 deletions

View File

@ -1,6 +1,7 @@
"""Tests for ui elements."""
import pandas as pd
import pytest
from sqlalchemy.orm import Session
from aki_prj23_transparenzregister.ui import data_elements
@ -111,3 +112,19 @@ def test_get_news_of_one_company1(news_db: Session) -> None:
"title": "AI Revolution in Tech",
},
]
@pytest.mark.working_on()
def test_options(full_db: Session) -> None:
"""Tests if the options can be generated."""
options = data_elements.get_options(full_db)
assert options == {
"c_1": "Some Company GmbH",
"c_2": "Other Company GmbH",
"c_3": "Third Company GmbH",
"p_1": "Mustermann, Max",
"p_2": "Mustermann, Sabine",
"p_3": "Some Surname, Some Firstname",
"p_4": "Some Surname, Some Firstname",
"p_5": "Other Surname, Other Firstname",
}