Use the dedicated configuration attribute to determine if we are in test mode

Closes #10364472.

authorFlorent Cayré <florent.cayre@logilab.fr>
changesetb38332339907
branchdefault
phasepublic
hiddenno
parent revision#46c5a22b56f0 Protect against commented-out variables in instance's db config
child revision#f0783359015f Launch server_startup hooks after initializing the repo
files modified by this revision
cubicweb_celery/__init__.py
# HG changeset patch
# User Florent Cayré <florent.cayre@logilab.fr>
# Date 1453978240 -3600
# Thu Jan 28 11:50:40 2016 +0100
# Node ID b38332339907fe885766cc04c5b87a23c7206cb5
# Parent 46c5a22b56f06e457efac4dbee5a84b40bada7b1
Use the dedicated configuration attribute to determine if we are in test mode

Closes #10364472.

diff --git a/cubicweb_celery/__init__.py b/cubicweb_celery/__init__.py
@@ -61,11 +61,11 @@
1              return self.conf
2 
3      def setup_cw(self, cwconfig):
4          self.cwconfig = cwconfig
5 
6 -        if cwconfig.apphome is None:
7 +        if cwconfig.mode == 'test':
8              self.enable_test_mode()
9 
10          if self.conf_freezed:
11              return
12