Ejemplo n.º 1
0
 def test_01_package_page(self):
     query = model.Session.query(model.Package)
     page = AlphaPage(
         collection=query,
         alpha_attribute='title',
         page='A',
         other_text=other,
     )
     pager = page.pager()
     assert_true(
         pager.startswith('<div class="pagination pagination-alphabet">'),
         pager)
     assert_in('<li class="active"><a href="/tag?page=A">A</a></li>', pager,
               pager)
     assert_true(
         re.search(r'\<li\>\<a href="\/tag\?page=B"\>B\<\/a\>\<\/li\>',
                   pager), pager)
     assert_true(
         re.search(
             r'\<li class="disabled"\>\<a href="\/tag\?page=E"\>E'
             r'\<\/a\>\<\/li\>', pager), pager)
     assert_true(
         re.search(
             r'\<li\>\<a href="\/tag\?page=Other"\>Other\<\/a\>\<\/li\>',
             pager), pager)
Ejemplo n.º 2
0
 def test_01_package_page(self):
     query = model.Session.query(model.Package)
     page = AlphaPage(
         collection=query,
         alpha_attribute='title',
         page='A',
         other_text=other,
     )
     pager = page.pager()
     assert not pager
Ejemplo n.º 3
0
 def test_01_package_page(self):
     query = model.Session.query(model.Package)
     page = AlphaPage(
         collection=query,
         alpha_attribute='title',
         page='A',
         other_text=other,
     )
     pager = page.pager()
     assert not pager
Ejemplo n.º 4
0
 def test_01_package_page(self):
     query = model.Session.query(model.Package)
     page = AlphaPage(
         collection=query,
         alpha_attribute='title',
         page='A',
         other_text=other,
     )
     pager = page.pager()
     assert_true(
         pager.startswith(
             '<div class="pagination pagination-alphabet">'
         ),
         pager
     )
     assert_in(
         '<li class="active"><a href="/tag?page=A">A</a></li>',
         pager,
         pager
     )
     assert_true(
         re.search(
             r'\<li\>\<a href="\/tag\?page=B"\>B\<\/a\>\<\/li\>',
             pager
         ),
         pager
     )
     assert_true(
         re.search(
             r'\<li class="disabled"\>\<a href="\/tag\?page=E"\>E'
             r'\<\/a\>\<\/li\>',
             pager
         ),
         pager
     )
     assert_true(
         re.search(
             r'\<li\>\<a href="\/tag\?page=Other"\>Other\<\/a\>\<\/li\>',
             pager
         ),
         pager
     )