Revision 747e30c3
Utilisation de unitest.TestCase dans les tests de VigiBoard.
git-svn-id: https://vigilo-dev.si.c-s.fr/svn@2571 b22e2e97-25c9-44ff-b637-2e5ceca36478
vigiboard/tests/__init__.py | ||
---|---|---|
4 | 4 |
from os import path, environ |
5 | 5 |
import sys |
6 | 6 |
|
7 |
import unittest |
|
7 | 8 |
from tg import config |
8 | 9 |
from paste.deploy import loadapp |
9 | 10 |
from paste.script.appinstall import SetupCommand |
10 | 11 |
from routes import url_for |
11 | 12 |
from webtest import TestApp |
12 |
from nose.tools import eq_ |
|
13 | 13 |
|
14 | 14 |
from vigilo.models.session import metadata, DBSession |
15 | 15 |
|
... | ... | |
27 | 27 |
engine = config['pylons.app_globals'].sa_engine |
28 | 28 |
metadata.drop_all(engine) |
29 | 29 |
|
30 |
class TestController(object):
|
|
30 |
class TestController(unittest.TestCase):
|
|
31 | 31 |
""" |
32 | 32 |
Base functional test case for the controllers. |
33 | 33 |
|
... | ... | |
46 | 46 |
|
47 | 47 |
application_under_test = 'main_without_authn' |
48 | 48 |
|
49 |
def __init__(self): |
|
50 |
object.__init__(self) |
|
51 |
|
|
52 | 49 |
def setUp(self): |
53 | 50 |
"""Method called by nose before running each test""" |
54 | 51 |
# Loading the application: |
55 |
setup_db() |
|
56 | 52 |
conf_dir = config.here |
57 | 53 |
wsgiapp = loadapp('config:test.ini#%s' % |
58 | 54 |
self.application_under_test, relative_to=conf_dir) |
Also available in: Unified diff