def test_get_attr_basic_lookup(self): """Test template filter for getting attributes from objects""" self.assertTrue(isinstance(get_attr(self.dummy, 'test'), str)) self.assertTrue( isinstance(get_attr(self.dummy, 'dummyobject'), AnotherDummyObject)) self.assertEqual(get_attr(self.dummy, 'tes'), "")
def test_get_attr_chained_lookup_error(self): """Test template filter for getting attributes from objects""" self.assertEqual(get_attr(self.dummy, 'dummyobject.tes'),"")
def test_get_attr_chained_lookup(self): """Test template filter for getting attributes from objects""" self.assertTrue( isinstance(get_attr(self.dummy, 'dummyobject.test'), str))