Ejemplo n.º 1
0
    def test_getlist(self):
        """The getlist should return a list of bookmarks 
        
        and abide by the limit option
        
        """
        blist = BookmarkManager.get_list()

        self.assertEquals(len(blist), 3)

        blist2 = BookmarkManager.get_list(limit=2)
        self.assertEquals(len(blist2), 2)
Ejemplo n.º 2
0
    def test_getlist(self):
        """The getlist should return a list of bookmarks 
        
        and abide by the limit option
        
        """
        blist = BookmarkManager.get_list()

        self.assertEquals(len(blist), 3)

        blist2 = BookmarkManager.get_list(limit=2)
        self.assertEquals(len(blist2), 2)
Ejemplo n.º 3
0
    def test_getlist_sorting(self):
        """getlist should also accept sorting parameters


        """
        blist = BookmarkManager.get_list(order_by=Bookmark.url, order=model.ORDER_DESC)
        self.assertEquals(blist[0].url, 'http://yahoo.com')

        blist = BookmarkManager.get_list(order_by=Bookmark.url)
        self.assertEquals(blist[0].url, 'http://cnn.com')

        blist = BookmarkManager.get_list(order_by=Bookmark.added)
        self.assertEquals(blist[0].url, 'http://google.com')
Ejemplo n.º 4
0
    def test_getlist_sorting(self):
        """getlist should also accept sorting parameters


        """
        blist = BookmarkManager.get_list(order_by=Bookmark.url,
                                         order=model.ORDER_DESC)
        self.assertEquals(blist[0].url, 'http://yahoo.com')

        blist = BookmarkManager.get_list(order_by=Bookmark.url)
        self.assertEquals(blist[0].url, 'http://cnn.com')

        blist = BookmarkManager.get_list(order_by=Bookmark.added)
        self.assertEquals(blist[0].url, 'http://google.com')
Ejemplo n.º 5
0
    def test_tied_list_tags(self):
        """Test that we can get the bookmarks with the tags data"""

        blist = BookmarkManager.get_list(with_tags=True)

        for b in blist:
            self.assertTrue(len(b.tags) > 0)
Ejemplo n.º 6
0
    def test_tied_list_tags(self):
        """Test that we can get the bookmarks with the tags data"""

        blist = BookmarkManager.get_list(with_tags=True)

        for b in blist:
            self.assertTrue(len(b.tags) > 0)