Skip to content

Commit

Permalink
Speedup test suite by using weak hash algo
Browse files Browse the repository at this point in the history
Default password hasher is slow by design and the test suite creates many
users. Relevant doc: https://docs.djangoproject.com/en/1.9/topics/testing/overview/#password-hashing

On my laptop, repeated `time make test` goes from ~110s to ~58s.
  • Loading branch information
vhf committed Aug 9, 2016
1 parent 2e84c42 commit 6b55294
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions example_project/example_project/settings.py
Expand Up @@ -130,4 +130,9 @@
STATIC_URL = '/static/'
STATIC_ROOT = 'staticfiles'


TESTING = sys.argv[1:2] == ['test']
if TESTING:
PASSWORD_HASHERS = ('django.contrib.auth.hashers.MD5PasswordHasher',)

setup_orchestra(__name__)

0 comments on commit 6b55294

Please sign in to comment.