Skip to content

Commit

Permalink
Add decorator tests
Browse files Browse the repository at this point in the history
  • Loading branch information
grantmcconnaughey committed Jan 14, 2016
1 parent 8de46e1 commit 7a6918d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/tests.py
Expand Up @@ -10,6 +10,8 @@
get_tag_html, set_lazy_tag_data, get_lib_and_tag_name
)

from .templatetags import test_tags


class LazyTagsViewTests(TestCase):

Expand Down Expand Up @@ -64,6 +66,18 @@ def test_custom_error_message(self):

self.assertIn('<p>Custom error message!</p>', html)

def test_decorated_tag_renders_html(self):
result = test_tags.test_simple_dec_args(1, kwarg='hello')

self.assertIn('class="lazy-tag"', result)
self.assertIn('class="lazy-tag-spinner-container"', result)

def test_decorated_tag_with_render_tag_renders_tag(self):
result = test_tags.test_simple_dec_args(1, kwarg='hello',
render_tag=True)

self.assertEqual(result, '1 hello')


class LazyTagsUtilsTests(TestCase):

Expand Down

0 comments on commit 7a6918d

Please sign in to comment.