def attributes(var): """ Given a variable in the template's context, print and return the list of attributes thare accessible inside of the template. For example, private attributes or callables that require arguments are excluded. """ attrs = get_attributes(var) pprint(attrs) return attrs
def test_valid_list(self): valid_attributes = set(get_attributes(self.test_object)) self.assertEqual(set(['has_kwargs', 'valid_method']), valid_attributes, 'has_kwargs and valid_method are the only valid routines of TestObject' )
def test_valid_list(self): valid_attributes = set(get_attributes(self.test_object)) self.assertEqual( set(['has_kwargs', 'valid_method']), valid_attributes, 'has_kwargs and valid_method are the only valid routines of TestObject' )