def test_getlist_sorting(self): """getlist should also accept sorting parameters """ taglist = TagManager.get_list(order_by=Tag.name, order=model.ORDER_DESC) self.assertEquals(taglist[0].name, 'python') taglist = TagManager.get_list(order_by=Tag.name) self.assertEquals(taglist[0].name, 'php') taglist = TagManager.get_list(order_by=Tag.id) self.assertEquals(taglist[0].id, 1)
def test_getlist(self): """The getlist should return a list of tags and abide by the limit option """ log.debug(meta.metadata.tables) taglist = TagManager.get_list() self.assertEquals(len(taglist), 3) taglist2 = TagManager.get_list(limit=2) self.assertEquals(len(taglist2), 2)
def test_getlist_byname(self): """Test that given a list of names we can get a list of objects back""" taglist = TagManager.get_list(tag_names=['pylons', 'php']) self.assertEquals(len(taglist), 2) for t in taglist: self.assertTrue(t.name in ['pylons', 'php'])