toolshed/backend/backend/test_runner.py
jedi 816543a0ab
All checks were successful
continuous-integration/drone/push Build is passing
speed up test execution by using in memory files and md5 password hashes
2023-06-29 00:15:15 +02:00

21 lines
700 B
Python

from django.conf import settings
from django.test.runner import DiscoverRunner
class FastTestRunner(DiscoverRunner):
def setup_test_environment(self):
super(FastTestRunner, self).setup_test_environment()
# Don't write files
settings.STORAGES = {
'default': {
'BACKEND': 'django.core.files.storage.InMemoryStorage',
'OPTIONS': {
'base_url': '/media/',
'location': '',
},
},
}
# Bonus: Use a faster password hasher. This REALLY helps.
settings.PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)