equal
deleted
inserted
replaced
87 |
87 |
88 class CubicWebServerTC(CubicWebTC): |
88 class CubicWebServerTC(CubicWebTC): |
89 """Class for running test web server. See :class:`CubicWebServerConfig`. |
89 """Class for running test web server. See :class:`CubicWebServerConfig`. |
90 |
90 |
91 Class attributes: |
91 Class attributes: |
92 * `anonymous_logged`: flag telling if anonymous user should be logged-in |
92 * `anonymous_allowed`: flag telling if anonymous browsing should be allowed |
93 by default (True by default) XXX (syt) s/logged-in/allowed/ ? |
|
94 """ |
93 """ |
95 configcls = CubicWebServerConfig |
94 configcls = CubicWebServerConfig |
96 # anonymous is logged by default in cubicweb test cases |
95 # anonymous is logged by default in cubicweb test cases |
97 anonymous_logged = True |
96 anonymous_allowed = True |
98 |
97 |
99 def start_server(self): |
98 def start_server(self): |
100 # use a semaphore to avoid starting test while the http server isn't |
99 # use a semaphore to avoid starting test while the http server isn't |
101 # fully initilialized |
100 # fully initilialized |
102 semaphore = threading.Semaphore(0) |
101 semaphore = threading.Semaphore(0) |
187 print err |
186 print err |
188 super(CubicWebServerTC, self).tearDown() |
187 super(CubicWebServerTC, self).tearDown() |
189 |
188 |
190 @classmethod |
189 @classmethod |
191 def init_config(cls, config): |
190 def init_config(cls, config): |
192 if not cls.anonymous_logged: |
191 config.set_anonymous_allowed(cls.anonymous_allowed) |
193 config.anonymous_credential = None |
|
194 super(CubicWebServerTC, cls).init_config(config) |
192 super(CubicWebServerTC, cls).init_config(config) |