# HG changeset patch # User RĂ©mi Cardona # Date 1448623577 -3600 # Node ID eb05348b0e2d381af65f85dc421b0daa6c966955 # Parent c3606b52092cb57329472b06c3449064b8dc92b5 [devtools] Disable anonymous login right before executing tests CubicWebTC.init_config is called many times, especially when creating the default database. This database is then reused by all tests in the same directory. The issue is that, if a test has 'anonymous_allowed' set to False, the anonymous user won't be created by postcreate.py in the default database. All other tests will fail miserably if they expected anonymous login to work. By actually disabling anonymous login after _init_repo, the default database (and configuration) will be initialized with a working anonymous user. Closes #7485127. diff -r c3606b52092c -r eb05348b0e2d devtools/testlib.py --- a/devtools/testlib.py Mon Nov 30 15:53:35 2015 +0100 +++ b/devtools/testlib.py Fri Nov 27 12:26:17 2015 +0100 @@ -372,7 +372,6 @@ config.global_set_option('embed-allowed', re.compile('.*')) except Exception: # not in server only configuration pass - config.set_anonymous_allowed(cls.anonymous_allowed) @property def vreg(self): @@ -410,6 +409,7 @@ self.__class__._repo_init_failed = ex raise self.addCleanup(self._close_access) + self.config.set_anonymous_allowed(self.anonymous_allowed) self.setup_database() MAILBOX[:] = [] # reset mailbox