Пример #1
0
    def test_direct_pass(self):
        self.model.attached_view = jv.JinjaView(text=self.TEMPL_STR)

        self.assertEqual('int is 1, string is value',
                         six.text_type(self.model))
Пример #2
0
    def test_is_deepcopiable(self):
        view_orig = jv.JinjaView(text=self.TEMPL_STR)
        view_cpy = copy.deepcopy(view_orig)

        self.assertIsNot(view_orig, view_cpy)
Пример #3
0
    def test_load_from_file(self):
        self.model.attached_view = jv.JinjaView(path='a/b/c/d.jinja.txt')

        self.assertEqual('int is 1, string is value',
                         six.text_type(self.model))
        self.MM_FILE.assert_called_with_once('a/b/c/d.jinja.txt')