Exemplo n.º 1
0
 def test_widget_render_js(self):
     widget = FancyTreeWidget()
     attrs = {'id': 'fancyfoo'}
     html = widget.render("foo", ["1", "2"], attrs)
     self.assertTrue('.fancytree({' in html)
     self.assertTrue(
         '<ul class="fancytree_checkboxes" id="fancyfoo_checkboxes">' in
         html)
Exemplo n.º 2
0
 class Meta:
     model = Selection
     fields = ('name', 'categories')
     widgets = {'categories': FancyTreeWidget(queryset=categories)}
Exemplo n.º 3
0
 def test_widget_loads(self):
     widget = FancyTreeWidget()
     self.assertIsInstance(widget, FancyTreeWidget)
Exemplo n.º 4
0
 def test_widget_render_single_value(self):
     widget = FancyTreeWidget()
     attrs = {'id': 'fancyfoo'}
     html = widget.render("foo", "1", attrs)
     self.assertTrue('.fancytree({' in html)
Exemplo n.º 5
0
 def test_widget_render_js(self):
     widget = FancyTreeWidget()
     attrs = {'id': 'fancyfoo'}
     html = widget.render("foo", ["1", "2"], attrs)
     self.assertTrue('.fancytree({' in html)
     self.assertTrue('<ul class="fancytree_checkboxes" id="fancyfoo_checkboxes">' in html)
Exemplo n.º 6
0
 def test_widget_render_single_value(self):
     widget = FancyTreeWidget()
     attrs = {'id': 'fancyfoo'}
     html = widget.render("foo", "1", attrs)
     self.assertTrue('.fancytree({' in html)