Commit f6496f55 authored by chris's avatar chris

content/test: add basic test

parent f656b422
......@@ -5,3 +5,4 @@ venv
media
local_settings.py
docs/_build
.ropeproject
......@@ -6,6 +6,7 @@ Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from flyers.content.models import Page
class SimpleTest(TestCase):
......@@ -14,3 +15,16 @@ class SimpleTest(TestCase):
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
class AnimalTestCase(TestCase):
def setUp(self):
Page.objects.create(title="foo")
foo = Page.objects.get(title="foo")
Page.objects.create(title="bar", parent=foo)
def test_animals_can_speak(self):
"""Animals that can speak are correctly identified"""
foo = Page.objects.get(title="foo")
bar = Page.objects.get(title="bar")
self.assertEqual(bar.parent, foo)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment