From 059f93cd179712b11f84d9f1a27d3b54cfc64a25 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 27 May 2013 10:25:43 +0200 Subject: [PATCH] Improved tests running a bit. --- compressor/test_settings.py | 18 +++++++++--------- compressor/tests/test_base.py | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/compressor/test_settings.py b/compressor/test_settings.py index 0e8a768..eea7d12 100644 --- a/compressor/test_settings.py +++ b/compressor/test_settings.py @@ -1,19 +1,15 @@ import os -import django TEST_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'tests') COMPRESS_CACHE_BACKEND = 'locmem://' -if django.VERSION[:2] >= (1, 3): - DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': ':memory:', - } +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': ':memory:', } -else: - DATABASE_ENGINE = 'sqlite3' +} INSTALLED_APPS = [ 'compressor', @@ -34,3 +30,7 @@ TEMPLATE_DIRS = ( TEST_RUNNER = 'discover_runner.DiscoverRunner' SECRET_KEY = "iufoj=mibkpdz*%bob952x(%49rqgv8gg45k36kjcg76&-y5=!" + +PASSWORD_HASHERS = ( + 'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher', +) diff --git a/compressor/tests/test_base.py b/compressor/tests/test_base.py index 8678e32..12321ff 100644 --- a/compressor/tests/test_base.py +++ b/compressor/tests/test_base.py @@ -5,7 +5,7 @@ import re from BeautifulSoup import BeautifulSoup from django.core.cache.backends import locmem -from django.test import TestCase +from django.test import SimpleTestCase from compressor.base import SOURCE_HUNK, SOURCE_FILE from compressor.conf import settings @@ -32,7 +32,7 @@ class TestPrecompiler(object): test_dir = os.path.abspath(os.path.join(os.path.dirname(__file__))) -class CompressorTestCase(TestCase): +class CompressorTestCase(SimpleTestCase): def setUp(self): settings.COMPRESS_ENABLED = True @@ -172,7 +172,7 @@ class CompressorTestCase(TestCase): settings.COMPRESS_PRECOMPILERS = original_precompilers -class CssMediaTestCase(TestCase): +class CssMediaTestCase(SimpleTestCase): def setUp(self): self.css = """\