tests: put 'TESTING=True' in the common conf

This commit is contained in:
Éloi Rivard 2024-12-05 14:55:56 +01:00
parent e89c10934a
commit 57bb0e01bc
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184
3 changed files with 1 additions and 5 deletions

View file

@ -161,8 +161,6 @@ def test_smtp_bad_tls(testclient, backend, smtpd, configuration):
@pytest.fixture
def themed_testclient(app, configuration, backend):
configuration["TESTING"] = True
root = os.path.dirname(os.path.abspath(__file__))
test_theme_path = os.path.join(root, "fixtures", "themes", "test")
configuration["CANAILLE"]["THEME"] = test_theme_path

View file

@ -31,7 +31,6 @@ format=[%(asctime)s] %(levelname)s in %(module)s: %(message)s
def test_file_log_config(configuration, backend, tmp_path, smtpd, admin):
configuration["TESTING"] = True
assert len(smtpd.messages) == 0
log_path = os.path.join(tmp_path, "canaille-by-file.log")
@ -63,7 +62,6 @@ def test_file_log_config(configuration, backend, tmp_path, smtpd, admin):
def test_dict_log_config(configuration, backend, tmp_path, smtpd, admin):
configuration["TESTING"] = True
assert len(smtpd.messages) == 0
log_path = os.path.join(tmp_path, "canaille-by-dict.log")
configuration["CANAILLE"]["LOGGING"] = {

View file

@ -68,6 +68,7 @@ def configuration(smtpd):
"SECRET_KEY": gen_salt(24),
"SERVER_NAME": "canaille.test",
"PREFERRED_URL_SCHEME": "http",
"TESTING": True,
"CANAILLE": {
"JAVASCRIPT": False,
"LOGO": "/static/img/canaille-head.webp",
@ -174,7 +175,6 @@ def app(configuration, backend, jinja_cache_directory):
@pytest.fixture
def testclient(app):
app.config["TESTING"] = True
app.jinja_env.undefined = StrictUndefined
yield TestApp(app)