aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_contrib/test_django/test_views.py
diff options
context:
space:
mode:
authorSean Brant2013-03-10 22:58:56 -0500
committerSean Brant2013-03-10 22:58:56 -0500
commita5d2c1a96e810dd2f0316269929a7bc8395add53 (patch)
treeecb99d51002da9eba4b4efb0577dc97f0e88e959 /tests/test_contrib/test_django/test_views.py
parent63ff8bab7cf4b818da6e50251f8a79cf1e1209d8 (diff)
downloadpykss-a5d2c1a96e810dd2f0316269929a7bc8395add53.tar.bz2
Adds django view tests
Diffstat (limited to 'tests/test_contrib/test_django/test_views.py')
-rw-r--r--tests/test_contrib/test_django/test_views.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_contrib/test_django/test_views.py b/tests/test_contrib/test_django/test_views.py
new file mode 100644
index 0000000..b47ce20
--- /dev/null
+++ b/tests/test_contrib/test_django/test_views.py
@@ -0,0 +1,18 @@
+import os
+
+from django.conf import settings
+from django.test import TestCase
+
+from pykss.contrib.django.views import StyleGuideMixin
+
+
+class StyleGuideMixinTestCase(TestCase):
+
+ def test_get_styleguide_get_dirs_from_settings(self):
+ css = os.path.join(settings.PROJECT_ROOT, 'tests', 'fixtures', 'css')
+ with self.settings(PYKSS_DIRS=[css]):
+ styleguide = StyleGuideMixin().get_styleguide()
+ self.assertEqual(styleguide.section('2.1.1').description, 'Your standard form button.')
+
+ def test_get_context_data_adds_sytleguide_to_context(self):
+ self.assertIn('styleguide', StyleGuideMixin().get_context_data())