Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Commit

Permalink
Improved linked list group item test
Browse files Browse the repository at this point in the history
  • Loading branch information
timorieber committed May 4, 2015
1 parent 348646d commit f72f292
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_htmltag_tag_is_rendered(self):

class ListGroupTagsTest(SimpleTestCase):
SAMPLE_LINK = 'http://example.org'
SAMPLE_LABEL = 'Linklabel'

LIST_GROUP_START = mark_safe('<ul class="list-group">')
LIST_GROUP_END = mark_safe('</ul>')
Expand All @@ -80,7 +81,8 @@ class ListGroupTagsTest(SimpleTestCase):

TEMPLATE_LINK = Template(
'{% load bootstrap_ui_tags %}'
'{% listgroupitem use_tag="a" link=link %}'
'{% listgroupitem use_tag="a" link=sample_link %}'
'{{ sample_label }}'
'{% endlistgroupitem %}'
)

Expand All @@ -105,9 +107,8 @@ def test_list_group_item_default_tag_is_rendered(self):
self.assertIn(self.LIST_GROUP_ITEM_END, rendered)

def test_list_group_item_link_is_rendered(self):
rendered = self.TEMPLATE_LINK.render(Context({'link': self.SAMPLE_LINK}))
self.assertIn(self.LIST_GROUP_ITEM_LINK_START, rendered)
self.assertIn(self.LIST_GROUP_ITEM_LINK_END, rendered)
rendered = self.TEMPLATE_LINK.render(Context({'sample_link': self.SAMPLE_LINK, 'sample_label': self.SAMPLE_LABEL}))
self.assertInHTML(self.LIST_GROUP_ITEM_LINK_START + self.SAMPLE_LABEL + self.LIST_GROUP_ITEM_LINK_END, rendered)


class PanelTagsTest(SimpleTestCase):
Expand Down

0 comments on commit f72f292

Please sign in to comment.