Skip to content

Commit

Permalink
Add client test to testproject
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Braak authored and Niels van Dijk committed Oct 10, 2013
1 parent 70507fd commit 4814868
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions testproject/fiber_test/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
{% load fiber_tags %}
<html lang="en">
<head>
<meta charset="utf-8" />
<title>{% block title %}{{ fiber_page.title }}{% endblock %}</title>
</head>
<body>
{% show_page_content "main" %}
</body>
</html>
15 changes: 15 additions & 0 deletions testproject/fiber_test/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from django.test import TestCase

from fiber.models import Page, ContentItem, PageContentItem


class FiberTests(TestCase):
def test_fiber(self):
# setup
frontpage = Page.objects.create(title='frontpage', url='/')
lorem_ipsum = ContentItem.objects.create(content_html='lorem ipsum')
PageContentItem.objects.create(page=frontpage, content_item=lorem_ipsum, block_name='main')

# - get page
response = self.client.get('/')
self.assertContains(response, 'lorem ipsum')
3 changes: 2 additions & 1 deletion testproject/testproject/settings_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
'compressor',
'easy_thumbnails',
'fiber',
'fiber_test',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
Expand All @@ -140,4 +141,4 @@
)

# Only run tests for fiber app
PROJECT_APPS = ['fiber']
PROJECT_APPS = ['fiber', 'fiber_test']

0 comments on commit 4814868

Please sign in to comment.