Example #1
0
    def test_prev_li_with_kwargs_filter(self):
        context = dict(offset=1, limit=5, DEFAULT_LIMIT=5)
        expected = '''
<li class="prev"><a href="/item_type?offset=0">&#8592; Previous</a></li>
        '''.strip()
        result = widgets.prev_li(context, item_url, self.kwargs_filter)
        result = lxml.html.tostring(result)
        assert expected == result
Example #2
0
    def test_prev_li_enabled(self):
        context = dict(offset=1, limit=5)
        expected = '''
<li class="prev"><a href="/item_type?limit=5&amp;offset=0">&#8592; Previous</a></li>
        '''.strip()
        result = widgets.prev_li(context, item_url)
        result = lxml.html.tostring(result)
        assert expected == result
Example #3
0
    def test_prev_li_disabled(self):
        context = dict(offset=0, limit=5)
        expected = '''
<li class="prev disabled"><a>&#8592; Previous</a></li>
        '''.strip()
        result = widgets.prev_li(context, item_url)
        result = lxml.html.tostring(result)
        assert expected == result
Example #4
0
    def test_prev_li_with_kwargs_filter(self):
        context = dict(offset=1, limit=5, DEFAULT_LIMIT=5)
        expected = '''
<li class="prev"><a href="/item_type?offset=0">&#8592; Previous</a></li>
        '''.strip()
        result = widgets.prev_li(context, item_url, self.kwargs_filter)
        result = lxml.html.tostring(result)
        assert expected == result
Example #5
0
    def test_prev_li_enabled(self):
        context = dict(offset=1, limit=5)
        expected = '''
<li class="prev"><a href="/item_type?limit=5&amp;offset=0">&#8592; Previous</a></li>
        '''.strip()
        result = widgets.prev_li(context, item_url)
        result = lxml.html.tostring(result)
        assert expected == result
Example #6
0
    def test_prev_li_disabled(self):
        context = dict(offset=0, limit=5)
        expected = '''
<li class="prev disabled"><a>&#8592; Previous</a></li>
        '''.strip()
        result = widgets.prev_li(context, item_url)
        result = lxml.html.tostring(result)
        assert expected == result