realms-wiki/realms/lib/test.py
Matthew Scragg bf3b3d3d74 added more tests
include img in manifest
disclaimer in root cli script
add blinker to dev tools
version file included in package
cli bug fixes
2014-10-22 15:38:32 -05:00

23 lines
704 B
Python

from flask.ext.testing import TestCase
from realms.lib.util import random_string
from realms import create_app
from subprocess import call
class BaseTest(TestCase):
def create_app(self):
app = create_app()
app.config['TESTING'] = True
app.config['PRESERVE_CONTEXT_ON_EXCEPTION'] = False
app.config['WIKI_PATH'] = '/tmp/%s' % random_string(12)
app.config['DB_URI'] = 'sqlite:////tmp/%s.db' % random_string(12)
app.config.update(self.configure())
return app
def configure(self):
return {}
def tearDown(self):
call(['rm', '-rf', self.app.config['WIKI_PATH']])
call(['rm', '-f', self.app.config['DB_URI'][10:]])