mirror of https://github.com/eyhc1/rendercv.git
test theme validator
This commit is contained in:
parent
1c531e6f76
commit
a9d68652a0
|
@ -101,6 +101,23 @@ class TestDataModel(unittest.TestCase):
|
||||||
with self.assertRaises(ValidationError):
|
with self.assertRaises(ValidationError):
|
||||||
data_model.Design(**input) # type: ignore
|
data_model.Design(**input) # type: ignore
|
||||||
|
|
||||||
|
def test_data_design_theme(self):
|
||||||
|
# Valid theme:
|
||||||
|
input = {
|
||||||
|
"theme": "classic",
|
||||||
|
}
|
||||||
|
with self.subTest(msg="valid theme"):
|
||||||
|
design = data_model.Design(**input) # type: ignore
|
||||||
|
self.assertEqual(design.theme, input["theme"])
|
||||||
|
|
||||||
|
# Nonexistent theme:
|
||||||
|
input = {
|
||||||
|
"theme": "nonexistent",
|
||||||
|
}
|
||||||
|
with self.subTest(msg="nonexistent theme"):
|
||||||
|
with self.assertRaises(ValidationError):
|
||||||
|
data_model.Design(**input) # type: ignore
|
||||||
|
|
||||||
def test_data_event_check_dates(self):
|
def test_data_event_check_dates(self):
|
||||||
# Inputs with valid dates:
|
# Inputs with valid dates:
|
||||||
input = {
|
input = {
|
||||||
|
|
Loading…
Reference in New Issue