Permalink
Browse files

Some boilerplate for wiki app.

  • Loading branch information...
rlr authored and James Socol committed Aug 19, 2010
1 parent 45c4b99 commit 9eb84ce3072afcc7234405e818254d9dbf4f9fda
@@ -0,0 +1,19 @@
+{# vim: set ts=2 et sts=2 sw=2: #}
+{% extends "layout/base.html" %}
+{% set styles = ('wiki',) %}
+{% set scripts = ('wiki',) %}
+
+{% block content_area %}
+
+<div id="main-content">
+ {% block content %}
+ {% endblock %}
+</div>
+
+{% endblock %}
+
+{% block breadcrumbs %}
+{% endblock %}
+
+{% block sidebar %}
+{% endblock %}
@@ -0,0 +1,5 @@
+{# vim: set ts=2 et sts=2 sw=2: #}
+{% extends "wiki/base.html" %}
+
+{% block content %}
+{% endblock %}
@@ -0,0 +1,20 @@
+from django.test import TestCase, client
+
+from sumo.urlresolvers import reverse
+
+
+get = lambda c, v, **kw: c.get(reverse(v, **kw), follow=True)
+post = lambda c, v, data={}, **kw: c.post(reverse(v, **kw), data, follow=True)
+
+
+class TestCaseBase(TestCase):
+ """Base TestCase for the wiki app test cases."""
+
+ fixtures = []
+
+ def setUp(self):
+ self.client = client.Client()
+ self.client.get('/')
+
+ def tearDown(self):
+ pass
@@ -0,0 +1,11 @@
+from nose.tools import eq_
+
+from wiki.tests import TestCaseBase, get
+
+
+class DocumentTests(TestCaseBase):
+ """Tests for the Document view/template"""
+
+ def test_document_view(self):
+ response = get(self.client, 'wiki.document', args=[1])
+ eq_(200, response.status_code)
View
@@ -0,0 +1,6 @@
+from django.conf.urls.defaults import patterns, url
+
+
+urlpatterns = patterns('wiki.views',
+ url(r'^/(?P<document_id>\d+)$', 'document', name='wiki.document'),
+)
View
@@ -1 +1,7 @@
-# Create your views here.
+import jingo
+
+
+def document(request, document_id):
+ """View a wiki document."""
+ return jingo.render(request, 'wiki/document.html',
+ {'document': None})
View
@@ -0,0 +1,3 @@
+/*
+ * Knowledge Base CSS
+ */
View
@@ -272,6 +272,9 @@ def JINJA_CONFIG():
'search': (
'css/search.css',
),
+ 'wiki': (
+ 'css/wiki.css',
+ ),
'ie': (
'css/ie.css',
),
@@ -296,7 +299,9 @@ def JINJA_CONFIG():
),
'forums': (
'js/markup.js',
- )
+ ),
+ 'wiki': (
+ ),
},
}
View
@@ -17,6 +17,7 @@
(r'^notifications', include('notifications.urls')),
(r'^flagged', include('flagit.urls')),
(r'^upload', include('upload.urls')),
+ (r'^kb', include('wiki.urls')),
# Kitsune admin (not Django admin).
(r'^admin/', include('kadmin.urls')),

0 comments on commit 9eb84ce

Please sign in to comment.