Esempio n. 1
0
    def setUpTestData(cls):
        Template.objects.bulk_create([
            Template(
                name="Template 1",
                type=TEMPLATE_TYPE_CONFIGURATION,
                template="Template 1",
            ),
            Template(
                name="Template 2",
                type=TEMPLATE_TYPE_CONFIGURATION,
                template="Template 2",
            ),
            Template(
                name="Template 3",
                type=TEMPLATE_TYPE_CONFIGURATION,
                template="Template 3",
            ),
        ])

        cls.form_data = {
            "name": "Routing Policy 4",
            "type": TEMPLATE_TYPE_EMAIL,
            "template": "Template 4",
            "comments": "",
            "tags": "",
        }
Esempio n. 2
0
class TemplateTest(TestCase):
    def setUp(self):
        super().setUp()
        self.template = Template(name="Test", template="{{ test }}")

    def test_render(self):
        self.assertEqual(self.template.render({"test": "test"}), "test")
Esempio n. 3
0
 def setUpTestData(cls):
     Template.objects.bulk_create([
         Template(
             name="Template 1",
             type=TEMPLATE_TYPE_CONFIGURATION,
             template="Template 1",
         ),
         Template(
             name="Template 2",
             type=TEMPLATE_TYPE_CONFIGURATION,
             template="Template 2",
         ),
         Template(name="Template 3",
                  type=TEMPLATE_TYPE_EMAIL,
                  template="Template 3"),
     ])
Esempio n. 4
0
 def setUp(self):
     super().setUp()
     self.template = Template(name="Test", template="{{ test }}")