Skip to content

Commit

Permalink
test: ensure logs only go to console during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-richards committed May 15, 2024
1 parent 06b99fa commit 1c3825b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions ietf/settings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,36 @@ def __getitem__(self, item):
TEMPLATES[0]['OPTIONS']['context_processors'] = [ p for p in TEMPLATES[0]['OPTIONS']['context_processors'] if not p in DEV_TEMPLATE_CONTEXT_PROCESSORS ] # pyflakes:ignore

REQUEST_PROFILE_STORE_ANONYMOUS_SESSIONS = False

# Override loggers with a safer set in case things go to the log during testing. Specifically,
# make sure there are no syslog loggers that might send things to a real syslog.
LOGGING["loggers"] = {
'django': {
'handlers': ['debug_console'],
'level': 'INFO',
},
'django.request': {
'handlers': ['debug_console'],
'level': 'ERROR',
},
'django.server': {
'handlers': ['django.server'],
'level': 'INFO',
},
'django.security': {
'handlers': ['debug_console', ],
'level': 'INFO',
},
'oidc_provider': {
'handlers': ['debug_console', ],
'level': 'DEBUG',
},
'datatracker': {
'handlers': ['debug_console'],
'level': 'INFO',
},
'celery': {
'handlers': ['debug_console'],
'level': 'INFO',
},
}

0 comments on commit 1c3825b

Please sign in to comment.