From 4e12193d8c631348a6eae3ab2c9faf01d0796d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Sat, 2 Jan 2016 23:04:03 +0200 Subject: [PATCH] Custom test runner for quicker tests. --- hc/api/tests/__init__.py | 12 ++++++++++++ hc/settings.py | 2 ++ 2 files changed, 14 insertions(+) diff --git a/hc/api/tests/__init__.py b/hc/api/tests/__init__.py index e69de29b..ad3f004f 100644 --- a/hc/api/tests/__init__.py +++ b/hc/api/tests/__init__.py @@ -0,0 +1,12 @@ +from django.conf import settings +from django.test.runner import DiscoverRunner + + +class CustomRunner(DiscoverRunner): + + def __init__(self, *args, **kwargs): + # For speed: + settings.PASSWORD_HASHERS = \ + ('django.contrib.auth.hashers.MD5PasswordHasher', ) + + super(CustomRunner, self).__init__(*args, **kwargs) diff --git a/hc/settings.py b/hc/settings.py index e755d55e..0c44bf6f 100644 --- a/hc/settings.py +++ b/hc/settings.py @@ -71,6 +71,8 @@ TEMPLATES = [ ] WSGI_APPLICATION = 'hc.wsgi.application' +TEST_RUNNER = 'hc.api.tests.CustomRunner' + # Default database engine is SQLite. So one can just check out code, # install requirements.txt and do manage.py runserver and it works