This repository has been archived by the owner on Oct 1, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eea8462
commit ff48be6
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') |