def test_set_data(self): data = Data('name') expected = Template(data=[data]) template = Template() template.data = [data] self.assertIsInstance(template.data, Array) self.assertEqual(template, expected)
def test_set_data_invalid(self): template = Template() invalid_obj = object() with self.assertRaises(TypeError): template.data = invalid_obj