Improved tests running a bit.
This commit is contained in:
@@ -1,19 +1,15 @@
|
|||||||
import os
|
import os
|
||||||
import django
|
|
||||||
|
|
||||||
TEST_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'tests')
|
TEST_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'tests')
|
||||||
|
|
||||||
COMPRESS_CACHE_BACKEND = 'locmem://'
|
COMPRESS_CACHE_BACKEND = 'locmem://'
|
||||||
|
|
||||||
if django.VERSION[:2] >= (1, 3):
|
DATABASES = {
|
||||||
DATABASES = {
|
'default': {
|
||||||
'default': {
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
'NAME': ':memory:',
|
||||||
'NAME': ':memory:',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else:
|
}
|
||||||
DATABASE_ENGINE = 'sqlite3'
|
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
'compressor',
|
'compressor',
|
||||||
@@ -34,3 +30,7 @@ TEMPLATE_DIRS = (
|
|||||||
TEST_RUNNER = 'discover_runner.DiscoverRunner'
|
TEST_RUNNER = 'discover_runner.DiscoverRunner'
|
||||||
|
|
||||||
SECRET_KEY = "iufoj=mibkpdz*%bob952x(%49rqgv8gg45k36kjcg76&-y5=!"
|
SECRET_KEY = "iufoj=mibkpdz*%bob952x(%49rqgv8gg45k36kjcg76&-y5=!"
|
||||||
|
|
||||||
|
PASSWORD_HASHERS = (
|
||||||
|
'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',
|
||||||
|
)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import re
|
|||||||
from BeautifulSoup import BeautifulSoup
|
from BeautifulSoup import BeautifulSoup
|
||||||
|
|
||||||
from django.core.cache.backends import locmem
|
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.base import SOURCE_HUNK, SOURCE_FILE
|
||||||
from compressor.conf import settings
|
from compressor.conf import settings
|
||||||
@@ -32,7 +32,7 @@ class TestPrecompiler(object):
|
|||||||
test_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
|
test_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
|
||||||
class CompressorTestCase(TestCase):
|
class CompressorTestCase(SimpleTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
settings.COMPRESS_ENABLED = True
|
settings.COMPRESS_ENABLED = True
|
||||||
@@ -172,7 +172,7 @@ class CompressorTestCase(TestCase):
|
|||||||
settings.COMPRESS_PRECOMPILERS = original_precompilers
|
settings.COMPRESS_PRECOMPILERS = original_precompilers
|
||||||
|
|
||||||
|
|
||||||
class CssMediaTestCase(TestCase):
|
class CssMediaTestCase(SimpleTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.css = """\
|
self.css = """\
|
||||||
<link rel="stylesheet" href="/static/css/one.css" type="text/css" media="screen">
|
<link rel="stylesheet" href="/static/css/one.css" type="text/css" media="screen">
|
||||||
|
|||||||
Reference in New Issue
Block a user