From 989c0f68d31d22568d365ccdb8b7b8d5f9fae297 Mon Sep 17 00:00:00 2001 From: Pierre Equoy Date: Tue, 13 Feb 2024 13:52:19 +0800 Subject: [PATCH] Add unit tests for the translation methods of the new fields --- checkbox-ng/plainbox/impl/unit/test_template.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/checkbox-ng/plainbox/impl/unit/test_template.py b/checkbox-ng/plainbox/impl/unit/test_template.py index 4473794a1..ead808f35 100644 --- a/checkbox-ng/plainbox/impl/unit/test_template.py +++ b/checkbox-ng/plainbox/impl/unit/test_template.py @@ -234,12 +234,24 @@ def test_template_description(self): }).template_description, "description") def test_tr_template_summary(self): + template = TemplateUnit({ + "_template-summary": "summary", + }) + self.assertEqual(template.tr_template_summary(), "summary") + + def test_translated_template_summary(self): """Ensure template_summary is populated with the translated field.""" self.assertEqual(TemplateUnit({ "_template-summary": "summary", }).template_summary, "summary") def test_tr_template_description(self): + template = TemplateUnit({ + "_template-description": "description", + }) + self.assertEqual(template.tr_template_description(), "description") + + def test_translated_template_description(self): """ Ensure template_description is populated with the translated field. """