Browse Source

Custom test runner for quicker tests.

pull/25/merge
Pēteris Caune 9 years ago
parent
commit
4e12193d8c
2 changed files with 14 additions and 0 deletions
  1. +12
    -0
      hc/api/tests/__init__.py
  2. +2
    -0
      hc/settings.py

+ 12
- 0
hc/api/tests/__init__.py View File

@ -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)

+ 2
- 0
hc/settings.py View File

@ -71,6 +71,8 @@ TEMPLATES = [
] ]
WSGI_APPLICATION = 'hc.wsgi.application' WSGI_APPLICATION = 'hc.wsgi.application'
TEST_RUNNER = 'hc.api.tests.CustomRunner'
# Default database engine is SQLite. So one can just check out code, # Default database engine is SQLite. So one can just check out code,
# install requirements.txt and do manage.py runserver and it works # install requirements.txt and do manage.py runserver and it works


Loading…
Cancel
Save