30 lines
994 B
Python
30 lines
994 B
Python
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from govoplan_identity.backend.manifest import manifest
|
|
|
|
|
|
class IdentityDocumentationContractTests(unittest.TestCase):
|
|
def test_all_static_topics_have_complete_german_content(self) -> None:
|
|
for topic in manifest.documentation:
|
|
german = (topic.translations or {}).get("de", {})
|
|
self.assertEqual({"title", "summary", "body"}, set(german), topic.id)
|
|
self.assertTrue(
|
|
all(str(value).strip() for value in german.values()), topic.id
|
|
)
|
|
|
|
def test_administration_is_permission_conditioned_workflow(self) -> None:
|
|
topic = next(
|
|
item
|
|
for item in manifest.documentation
|
|
if item.id == "identity.administration"
|
|
)
|
|
self.assertEqual("workflow", topic.metadata["kind"])
|
|
self.assertTrue(topic.conditions)
|
|
self.assertIn("user", topic.documentation_types)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|