coralnet
coralnet copied to clipboard
Consider overriding SITE_DIR setting for unit tests
The biggest reason is that log files are currently shared between the actual server and unit tests. We typically only run unit tests in dev environments (and maybe staging), but it'd still be nice to not clog up the log files with unit-test output. If unit tests use a separate SITE_DIR
, then that directory could be cleaned up after testing.
Other files located based on SITE_DIR
include tmp
files, and the maintenance-status file (from issue #155). We might also be able to simplify the CACHES
setting override, which looks like this right now:
test_settings['CACHES'] = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'test',
}
}
In PR #324, we had to mute the logger during testing, perhaps because of how spacer uses the logging module. So if we still want the logger activated during unit tests (for example, to test the log output itself), then that is something that needs resolving.