<s> from django . test import TestCase <EOL> from table . widgets import * <EOL> from table . tables import Table , TableWidgets <EOL> class TableWidgetsTestCase ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_searchbox ( self ) : <EOL> searchbox = SearchBox ( ) <EOL> self . assertEqual ( searchbox . dom , "<STR_LIT>" ) <EOL> self . assertEqual ( searchbox . placeholder , "<STR_LIT>" ) <EOL> searchbox = SearchBox ( visible = False ) <EOL> self . assertEqual ( searchbox . dom , "<STR_LIT>" ) <EOL> def test_pagiantion ( self ) : <EOL> pagination = Pagination ( ) <EOL> self . assertEqual ( pagination . first , "<STR_LIT>" ) <EOL> self . assertEqual ( pagination . last , "<STR_LIT>" ) <EOL> self . assertEqual ( pagination . prev , "<STR_LIT>" ) <EOL> self . assertEqual ( pagination . next , "<STR_LIT>" ) <EOL> self . assertEqual ( <EOL> pagination . dom , <EOL> "<STR_LIT>" <EOL> ) <EOL> pagination = Pagination ( visible = False ) <EOL> self . assertEqual ( <EOL> pagination . dom , <EOL> "<STR_LIT>" <EOL> ) <EOL> def test_info_label ( self ) : <EOL> label = InfoLabel ( ) <EOL> self . assertEqual ( label . dom , "<STR_LIT>" ) <EOL> label = InfoLabel ( visible = False ) <EOL> self . assertEqual ( label . dom , "<STR_LIT>" ) <EOL> def test_length_menu ( self ) : <EOL> menu = LengthMenu ( ) <EOL> self . assertEqual ( menu . dom , "<STR_LIT>" ) <EOL> menu = LengthMenu ( visible = False ) <EOL> self . assertEqual ( menu . dom , "<STR_LIT>" ) <EOL> def test_extense_button ( self ) : <EOL> btn = ExtButton ( template = "<STR_LIT>" , context = { "<STR_LIT>" : "<STR_LIT:bar>" } ) <EOL> self . assertEqual ( btn . dom , "<STR_LIT>" ) <EOL> self . assertEqual ( btn . html , "<STR_LIT>" ) <EOL> btn = ExtButton ( visible = False ) <EOL> self . assertEqual ( btn . dom , "<STR_LIT>" ) <EOL> self . assertEqual ( btn . html , "<STR_LIT>" ) <EOL> def test_widgets_dom ( self ) : <EOL> class TestTable ( Table ) : <EOL> class Meta : <EOL> search_placeholder = "<STR_LIT:test>" <EOL> info_format = "<STR_LIT>" <EOL> pagination_first = "<STR_LIT:F>" <EOL> pagination_last = "<STR_LIT:L>" <EOL> pagination_prev = "<STR_LIT:P>" <EOL> pagination_next = "<STR_LIT:N>" <EOL> ext_button = True <EOL> ext_button_template = "<STR_LIT>" <EOL> ext_button_context = { "<STR_LIT>" : "<STR_LIT:bar>" } <EOL> table = TestTable ( [ ] ) <EOL> widgets = TableWidgets ( table ) <EOL> self . assertEqual ( widgets . search_box . placeholder , "<STR_LIT:test>" ) <EOL> self . assertEqual ( widgets . info_label . format , "<STR_LIT>" ) <EOL> self . assertEqual ( widgets . pagination . first , "<STR_LIT:F>" ) <EOL> self . assertEqual ( widgets . pagination . last , "<STR_LIT:L>" ) <EOL> self . assertEqual ( widgets . pagination . prev , "<STR_LIT:P>" ) <EOL> self . assertEqual ( widgets . pagination . next , "<STR_LIT:N>" ) <EOL> self . assertEqual ( widgets . ext_button . html , "<STR_LIT>" ) <EOL> self . assertEqual ( <EOL> widgets . render_dom ( ) , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) <EOL> def test_widgets_dom_simple ( self ) : <EOL> class SimpleTable ( Table ) : <EOL> class Meta : <EOL> search = False <EOL> pagination = False <EOL> info = False <EOL> length_menu = False <EOL> table = SimpleTable ( [ ] ) <EOL> widgets = TableWidgets ( table ) <EOL> self . assertEqual ( widgets . render_dom ( ) , "<STR_LIT>" ) </s>
