Revision 07694f25
Suppression référence à url_for (pas utilisé/utilise dans/par les tests).
git-svn-id: https://vigilo-dev.si.c-s.fr/svn@4938 b22e2e97-25c9-44ff-b637-2e5ceca36478
vigigraph/tests/__init__.py | ||
---|---|---|
8 | 8 |
from tg import config |
9 | 9 |
from paste.deploy import loadapp |
10 | 10 |
from paste.script.appinstall import SetupCommand |
11 |
from routes import url_for |
|
12 | 11 |
from webtest import TestApp |
13 | 12 |
|
14 | 13 |
from vigilo.models.session import metadata, DBSession |
15 | 14 |
|
16 |
__all__ = ['setup_db', 'teardown_db', 'TestController', 'url_for']
|
|
15 |
__all__ = ['setup_db', 'teardown_db', 'TestController'] |
|
17 | 16 |
|
18 | 17 |
def setup_db(): |
19 | 18 |
"""Method used to build a database""" |
... | ... | |
30 | 29 |
class TestController(unittest.TestCase): |
31 | 30 |
""" |
32 | 31 |
Base functional test case for the controllers. |
33 |
|
|
34 |
The vigigraph application instance (``self.app``) set up in this test
|
|
32 |
|
|
33 |
The vigigraph application instance (``self.app``) set up in this test |
|
35 | 34 |
case (and descendants) has authentication disabled, so that developers can |
36 | 35 |
test the protected areas independently of the :mod:`repoze.who` plugins |
37 | 36 |
used initially. This way, authentication can be tested once and separately. |
38 |
|
|
37 |
|
|
39 | 38 |
Check vigigraph.tests.functional.test_authentication for the repoze.who |
40 | 39 |
integration tests. |
41 |
|
|
40 |
|
|
42 | 41 |
This is the officially supported way to test protected areas with |
43 | 42 |
repoze.who-testutil (http://code.gustavonarea.net/repoze.who-testutil/). |
44 |
|
|
43 |
|
|
45 | 44 |
""" |
46 |
|
|
45 |
|
|
47 | 46 |
application_under_test = 'main_without_authn' |
48 |
|
|
47 |
|
|
49 | 48 |
def setUp(self): |
50 | 49 |
"""Method called by nose before running each test""" |
51 | 50 |
# Loading the application: |
... | ... | |
57 | 56 |
test_file = path.join(conf_dir, 'test.ini') |
58 | 57 |
cmd = SetupCommand('setup-app') |
59 | 58 |
cmd.run([test_file]) |
60 |
|
|
59 |
|
|
61 | 60 |
def tearDown(self): |
62 | 61 |
"""Method called by nose after running each test""" |
63 | 62 |
# Cleaning up the database: |
64 | 63 |
teardown_db() |
65 | 64 |
del self.app |
66 |
|
Also available in: Unified diff