Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
Add initial Config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ellisonleao committed Nov 21, 2013
1 parent 5b8ff42 commit 9971a1d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion quokka/core/tests/test_models.py
@@ -1,7 +1,7 @@
# coding: utf-8
from . import BaseTestCase

from ..models import Channel
from ..models import Channel, Config


class TestChannel(BaseTestCase):
Expand All @@ -20,6 +20,7 @@ def setUp(self):

def tearDown(self):
self.channel.delete()
self.parent.delete()

def test_channel_fields(self):
self.assertEqual(self.channel.title, u'Monkey Island')
Expand Down Expand Up @@ -58,3 +59,20 @@ def test_get_canonical_url(self):
'/father/monkey-island/')
self.assertEqual(self.parent.get_canonical_url(),
'/father/')


class TestConfig(BaseTestCase):
def setUp(self):
# Create method was not returning the created object with
# the create() method
self.config, new = Config.objects.get_or_create(
group=u'test group',
)

def tearDown(self):
self.config.delete()

def test_config_fields(self):
self.assertEqual(self.config.group, u'test group')
self.assertEqual(self.config.content_format, 'html')
self.assertEqual(unicode(self.config), u'test group')

0 comments on commit 9971a1d

Please sign in to comment.