Skip to content

Commit

Permalink
Added missing assertions in widget_attrs test
Browse files Browse the repository at this point in the history
  • Loading branch information
jpic committed Jan 28, 2014
1 parent 12fca19 commit 80e8e5c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion autocomplete_light/tests/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ def test_init_without_registry(self):
widget = self.widget_class('FkModelAutocomplete')
self.assertEqual(widget.autocomplete.model, FkModel)

def test_widget_data_attributes(self):
def test_widget_attrs(self):
widget = self.widget_class('FkModelAutocomplete',
widget_attrs={'data-widget-foo': 'bar', 'class':'foobar'})
html = widget.render('somewidget', None)
et = etree.fromstring(html)

self.assertEquals(et.attrib['data-widget-foo'], 'bar')
self.assertIn('foobar', et.attrib['class'])
self.assertIn('autocomplete-light-widget', et.attrib['class'])

def test_widget_js_attributes_deprecation(self):
with self.assertRaises(PendingDeprecationWarning) as context:
Expand Down

0 comments on commit 80e8e5c

Please sign in to comment.