diff options
| author | Sean Brant | 2013-03-13 22:23:50 -0500 | 
|---|---|---|
| committer | Sean Brant | 2013-03-13 22:23:50 -0500 | 
| commit | c7d7aad2913d666a9ad09d74976bb90eff03acd1 (patch) | |
| tree | 2085154feb77942ef8760f9c4eb4486cc24687f7 /tests/test_contrib | |
| parent | 083e4dd9ed498ba2ef5133943fadb1fab7e71276 (diff) | |
| download | pykss-c7d7aad2913d666a9ad09d74976bb90eff03acd1.tar.bz2 | |
Adds support for adding examples inside comments
Diffstat (limited to 'tests/test_contrib')
| -rw-r--r-- | tests/test_contrib/test_django/test_templatetags/test_pykss.py | 24 | 
1 files changed, 8 insertions, 16 deletions
| diff --git a/tests/test_contrib/test_django/test_templatetags/test_pykss.py b/tests/test_contrib/test_django/test_templatetags/test_pykss.py index f066499..d24f1ae 100644 --- a/tests/test_contrib/test_django/test_templatetags/test_pykss.py +++ b/tests/test_contrib/test_django/test_templatetags/test_pykss.py @@ -7,7 +7,6 @@ from django.utils import simplejson  from mock import patch, ANY -from pykss.exceptions import SectionDoesNotExist  from pykss.parser import Parser @@ -17,25 +16,14 @@ class StyleguideBlockTestCase(TestCase):          css = os.path.join(settings.PROJECT_ROOT, 'tests', 'fixtures', 'css')          self.styleguide = Parser(css) -    def test_when_section_does_not_exist_and_in_debug(self): +    def test_when_section_does_not_exist(self):          template = Template("""              {% load pykss %}              {% styleguideblock styleguide "99" %}              {% endstyleguideblock %}          """)          context = Context({'styleguide': self.styleguide}) -        self.assertRaises(SectionDoesNotExist, template.render, context) - -    def test_when_section_does_not_exist_and_not_in_debug(self): -        with self.settings(TEMPLATE_DEBUG=False): -            template = Template(""" -                {% load pykss %} -                {% styleguideblock styleguide "99" %} -                {% endstyleguideblock %} -            """) -            context = Context({'styleguide': self.styleguide}) -            results = template.render(context) -            self.assertEqual(results.strip(), '') +        self.assertEquals(template.render(context).strip(), '')      @patch('pykss.contrib.django.templatetags.pykss.render_to_string')      def test_uses_default_template(self, mock_render_to_string): @@ -79,7 +67,7 @@ class StyleguideBlockTestCase(TestCase):          template = Template("""              {% load pykss %}              {% styleguideblock styleguide "2.1.1" using "django.html" %} -                <i class="main{{ modifier_class }}"></i> +                <i class="main$modifier_class"></i>              {% endstyleguideblock %}          """)          context = Context({'styleguide': self.styleguide}) @@ -90,4 +78,8 @@ class StyleguideBlockTestCase(TestCase):          self.assertEqual(results['modifiers'][0], [':hover', 'Highlights when hovering.'])          self.assertEqual(results['example_html'], '<i class="main"></i>')          self.assertEqual(results['modifier_examples'][0], [':hover', '<i class="main pseudo-class-hover"></i>']) -        self.assertEqual(results['escaped_html'], '<i class="main"></i>') + + +#class RenderStyleguideTestCase(TestCase): + +#    def test_renders_correctly(self): | 
