Ejemplo 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": "",
        }
Ejemplo 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")
Ejemplo 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"),
     ])
Ejemplo n.º 4
0
 def setUp(self):
     super().setUp()
     self.template = Template(name="Test", template="{{ test }}")