add anon user for TestServerConfiguration, no only AppTestConfiguration
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 23 Sep 2009 15:26:47 +0200
changeset 3435 84036ad2c82d
parent 3434 6d0f22f5d31f
child 3436 1e927f7ccb23
add anon user for TestServerConfiguration, no only AppTestConfiguration
devtools/__init__.py
--- a/devtools/__init__.py	Wed Sep 23 13:43:00 2009 +0200
+++ b/devtools/__init__.py	Wed Sep 23 15:26:47 2009 +0200
@@ -105,6 +105,8 @@
         self.init_log(log_threshold, force=True)
         # need this, usually triggered by cubicweb-ctl
         self.load_cwctl_plugins()
+        self.global_set_option('anonymous-user', 'anon')
+        self.global_set_option('anonymous-password', 'anon')
 
     anonymous_user = TwistedConfiguration.anonymous_user.im_func
 
@@ -116,6 +118,11 @@
         return abspath('..')
     appdatahome = apphome
 
+    def load_configuration(self):
+        super(TestServerConfiguration, self).load_configuration()
+        self.global_set_option('anonymous-user', 'anon')
+        self.global_set_option('anonymous-password', 'anon')
+
     def main_config_file(self):
         """return instance's control configuration file"""
         return join(self.apphome, '%s.conf' % self.name)
@@ -179,13 +186,6 @@
         BaseApptestConfiguration.__init__(self, appid, log_threshold=log_threshold)
         self.init_repository = sourcefile is None
         self.sourcefile = sourcefile
-        self.global_set_option('anonymous-user', 'anon')
-        self.global_set_option('anonymous-password', 'anon')
-
-    def load_configuration(self):
-        super(ApptestConfiguration, self).load_configuration()
-        self.global_set_option('anonymous-user', 'anon')
-        self.global_set_option('anonymous-password', 'anon')
 
 
 # test database handling #######################################################