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

Commit

Permalink
Add core initial tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ellisonleao committed Nov 21, 2013
1 parent eea8462 commit ff48be6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions quokka/core/tests/__init__.py
@@ -0,0 +1,13 @@
# coding: utf-8
from flask.ext.testing import TestCase

from quokka import create_app
from quokka.core.admin import create_admin


class BaseTestCase(TestCase):
def create_app(self):
self.admin = create_admin()
return create_app(config='quokka.test_settings',
admin_instance=self.admin,
test=True)
23 changes: 23 additions & 0 deletions quokka/core/tests/test_models.py
@@ -0,0 +1,23 @@
# coding: utf-8
from . import BaseTestCase

from ..models import Channel


class TestCoreModels(BaseTestCase):
def setUp(self):
# Create method was not returning the created object with
# the create() method
self.channel, new = Channel.objects.get_or_create(
title=u'Monkey Island',
description=u'The coolest pirate history ever',
)

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

def test_channel_fields(self):
self.assertEqual(self.channel.title, u'Monkey Island')
self.assertEqual(self.channel.slug, u'monkey-island')
self.assertEqual(self.channel.description,
u'The coolest pirate history ever')

0 comments on commit ff48be6

Please sign in to comment.