author | Nicolas Chauvat <nicolas.chauvat@logilab.fr> |
Thu, 14 Feb 2013 15:29:20 +0100 | |
changeset 8693 | a6ca96ec8693 |
parent 7856 | 51a3fb272bf3 |
child 10214 | 88f60d4b9952 |
permissions | -rw-r--r-- |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
1 |
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
2 |
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
3 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
4 |
# This file is part of CubicWeb. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
5 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
6 |
# CubicWeb is free software: you can redistribute it and/or modify it under the |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
7 |
# terms of the GNU Lesser General Public License as published by the Free |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
8 |
# Software Foundation, either version 2.1 of the License, or (at your option) |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
9 |
# any later version. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
10 |
# |
5424
8ecbcbff9777
replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5421
diff
changeset
|
11 |
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT |
5421
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
13 |
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
14 |
# details. |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
15 |
# |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
16 |
# You should have received a copy of the GNU Lesser General Public License along |
8167de96c523
proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4212
diff
changeset
|
17 |
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
18 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
19 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
20 |
""" |
7856
51a3fb272bf3
[skeleton] fix new class configuration in realdbtest
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
6781
diff
changeset
|
21 |
from cubicweb.devtools.testlib import CubicWebTC |
51a3fb272bf3
[skeleton] fix new class configuration in realdbtest
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
6781
diff
changeset
|
22 |
from cubicweb.devtools.realdbtest import buildconfig, loadconfig |
0 | 23 |
|
6781
5062d86d6ffe
[unittest2] use unittest2 module fixture api
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5424
diff
changeset
|
24 |
def setUpModule(options): |
0 | 25 |
if options.source: |
26 |
configcls = loadconfig(options.source) |
|
27 |
elif options.dbname is None: |
|
28 |
raise Exception('either <sourcefile> or <dbname> options are required') |
|
29 |
else: |
|
30 |
configcls = buildconfig(options.dbuser, options.dbpassword, |
|
31 |
options.dbname, options.euser, |
|
32 |
options.epassword) |
|
33 |
RealDatabaseTC.configcls = configcls |
|
34 |
||
7856
51a3fb272bf3
[skeleton] fix new class configuration in realdbtest
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
6781
diff
changeset
|
35 |
|
51a3fb272bf3
[skeleton] fix new class configuration in realdbtest
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
6781
diff
changeset
|
36 |
class RealDatabaseTC(CubicWebTC): |
6781
5062d86d6ffe
[unittest2] use unittest2 module fixture api
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
5424
diff
changeset
|
37 |
configcls = None # set by setUpModule() |
0 | 38 |
|
39 |
def test_all_primaries(self): |
|
40 |
for rset in self.iter_individual_rsets(limit=50): |
|
41 |
yield self.view, 'primary', rset, rset.req.reset_headers() |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
42 |
|
0 | 43 |
## startup views |
44 |
def test_startup_views(self): |
|
45 |
for vid in self.list_startup_views(): |
|
46 |
req = self.request() |
|
47 |
yield self.view, vid, None, req |
|
48 |
||
49 |
||
50 |
if __name__ == '__main__': |
|
51 |
from logilab.common.testlib import unittest_main |
|
52 |
unittest_main() |