コード例 #1
0
ファイル: test_widgets.py プロジェクト: Singletoned/wiseguy
    def test_next_li_with_kwargs_filter(self):
        context = dict(offset=0, limit=5, total=10, DEFAULT_LIMIT=5)
        expected = '''
<li class="next"><a href="/item_type?offset=5">Next &#8594;</a></li>
        '''.strip()
        result = widgets.next_li(context, item_url, self.kwargs_filter)
        result = lxml.html.tostring(result)
        assert expected == result
コード例 #2
0
ファイル: test_widgets.py プロジェクト: Singletoned/wiseguy
    def test_next_li_enabled(self):
        context = dict(offset=0, limit=5, total=10)
        expected = '''
<li class="next"><a href="/item_type?limit=5&amp;offset=5">Next &#8594;</a></li>
        '''.strip()
        result = widgets.next_li(context, item_url)
        result = lxml.html.tostring(result)
        assert expected == result
コード例 #3
0
ファイル: test_widgets.py プロジェクト: Singletoned/wiseguy
    def test_next_li_disabled(self):
        context = dict(offset=0, limit=5, total=5)
        expected = '''
<li class="next disabled"><a>Next &#8594;</a></li>
        '''.strip()
        result = widgets.next_li(context, item_url)
        result = lxml.html.tostring(result)
        assert expected == result
コード例 #4
0
    def test_next_li_with_kwargs_filter(self):
        context = dict(offset=0, limit=5, total=10, DEFAULT_LIMIT=5)
        expected = '''
<li class="next"><a href="/item_type?offset=5">Next &#8594;</a></li>
        '''.strip()
        result = widgets.next_li(context, item_url, self.kwargs_filter)
        result = lxml.html.tostring(result)
        assert expected == result
コード例 #5
0
    def test_next_li_enabled(self):
        context = dict(offset=0, limit=5, total=10)
        expected = '''
<li class="next"><a href="/item_type?limit=5&amp;offset=5">Next &#8594;</a></li>
        '''.strip()
        result = widgets.next_li(context, item_url)
        result = lxml.html.tostring(result)
        assert expected == result
コード例 #6
0
    def test_next_li_disabled(self):
        context = dict(offset=0, limit=5, total=5)
        expected = '''
<li class="next disabled"><a>Next &#8594;</a></li>
        '''.strip()
        result = widgets.next_li(context, item_url)
        result = lxml.html.tostring(result)
        assert expected == result