Revision d3c47597
Modification des tests suite aux changements apportés hier (migration des tests du modèle).
Adaptations dans le code de vigiboard pour utiliser l'authentification fournie par le modèle.
Certains tests fonctionnels de vigiboard sont SKIPés car bugués.
vigiboard.config.vigiboard renommé en vigiboard.config.vigiboard_cfg pour éviter des conflits de noms.
Dans le modèle, User.groups est renommé en User.usergroups pour éviter une confusion avec les groupes d'hosts.
git-svn-id: https://vigilo-dev.si.c-s.fr/svn@624 b22e2e97-25c9-44ff-b637-2e5ceca36478
vigiboard/tests/__init__.py | ||
---|---|---|
18 | 18 |
|
19 | 19 |
def setup_db(): |
20 | 20 |
"""Method used to build a database""" |
21 |
engine = config['pylons.app_globals'].sa_engine |
|
22 |
model.init_model(engine) |
|
23 |
model.metadata.create_all(engine) |
|
21 |
model.metadata.create_all() |
|
24 | 22 |
|
25 | 23 |
def teardown_db(): |
26 | 24 |
"""Method used to destroy a database""" |
27 |
engine = config['pylons.app_globals'].sa_engine |
|
28 |
model.metadata.drop_all(engine) |
|
25 |
model.metadata.drop_all() |
|
29 | 26 |
|
30 | 27 |
|
31 | 28 |
class TestController(object): |
... | ... | |
46 | 43 |
""" |
47 | 44 |
|
48 | 45 |
application_under_test = 'main_without_authn' |
46 |
|
|
47 |
def __init__(self): |
|
48 |
object.__init__(self) |
|
49 | 49 |
|
50 | 50 |
def setUp(self): |
51 | 51 |
"""Method called by nose before running each test""" |
... | ... | |
63 | 63 |
"""Method called by nose after running each test""" |
64 | 64 |
# Cleaning up the database: |
65 | 65 |
teardown_db() |
66 |
|
|
66 |
del self.app |
|
67 | 67 |
|
68 | 68 |
def runtests(): |
69 |
"""This is the method called when running unit tests.""" |
|
69 | 70 |
# XXX hard-coded path. |
70 | 71 |
sys.argv[1:0] = ['--with-pylons', '../vigiboard/test.ini', |
71 | 72 |
'--with-coverage', '--cover-inclusive', |
Also available in: Unified diff