Commit b9ccb5a7 by Timothée Peignier

reorganize tests

parent e710b992
...@@ -8,20 +8,20 @@ TEST_DIR = os.path.dirname(os.path.abspath(__file__)) ...@@ -8,20 +8,20 @@ TEST_DIR = os.path.dirname(os.path.abspath(__file__))
if not settings.configured: if not settings.configured:
settings.configure( settings.configure(
COMPRESS_CACHE_BACKEND = 'dummy://', COMPRESS_CACHE_BACKEND='dummy://',
DATABASE_ENGINE='sqlite3', DATABASE_ENGINE='sqlite3',
INSTALLED_APPS=[ INSTALLED_APPS=[
'compress', 'compress',
'tests', 'tests',
], ],
MEDIA_URL = '/media/', MEDIA_URL='/media/',
MEDIA_ROOT = os.path.join(TEST_DIR, 'media'), MEDIA_ROOT=os.path.join(TEST_DIR, 'media'),
STATIC_URL = '/static/', STATIC_URL='/static/',
STATIC_ROOT = os.path.join(TEST_DIR, 'static'), STATIC_ROOT=os.path.join(TEST_DIR, 'static'),
TEMPLATE_DIRS = ( TEMPLATE_DIRS=(
os.path.join(TEST_DIR, 'templates'), os.path.join(TEST_DIR, 'templates'),
), ),
TEST_DIR = TEST_DIR, TEST_DIR=TEST_DIR,
) )
from django.test.simple import run_tests from django.test.simple import run_tests
......
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
background-image: url(http://localhost/images/sprite-buttons.png); background-image: url(http://localhost/images/sprite-buttons.png);
} }
.no-protocol-url { .no-protocol-url {
background-image: url(//images/sprite-buttons.png); background-image: url(//images/sprite-buttons.png);
} }
\ No newline at end of file
from packager import *
from versioning import *
from compressor import *
from compiler import *
from django.test import TestCase
class CompilerTest(TestCase):
pass
...@@ -4,28 +4,6 @@ from django.test import TestCase ...@@ -4,28 +4,6 @@ from django.test import TestCase
from compress.conf import settings from compress.conf import settings
from compress.compressors import Compressor from compress.compressors import Compressor
from compress.packager import Packager
class PackagerTest(TestCase):
def setUp(self):
self.old_compress_url = settings.COMPRESS_URL
settings.COMPRESS_URL = 'http://localhost/static/'
def test_individual_url(self):
"""Check that individual URL is correctly generated"""
packager = Packager()
filename = os.path.join(settings.COMPRESS_ROOT, u'js/application.js')
individual_url = packager.individual_url(filename)
self.assertEqual(individual_url,
"http://localhost/static/js/application.js")
def tearDown(self):
settings.COMPRESS_URL = self.old_compress_url
class VersioningTest(TestCase):
pass
class CompressorTest(TestCase): class CompressorTest(TestCase):
...@@ -45,12 +23,8 @@ class CompressorTest(TestCase): ...@@ -45,12 +23,8 @@ class CompressorTest(TestCase):
background-image: url(http://localhost/images/sprite-buttons.png); background-image: url(http://localhost/images/sprite-buttons.png);
} }
.no-protocol-url { .no-protocol-url {
background-image: url(//images/sprite-buttons.png); background-image: url(//images/sprite-buttons.png);
}""", output) }""", output)
def tearDown(self): def tearDown(self):
settings.COMPRESS_URL = self.old_compress_url settings.COMPRESS_URL = self.old_compress_url
class CompilerTest(TestCase):
pass
import os
from django.test import TestCase
from compress.conf import settings
from compress.packager import Packager
class PackagerTest(TestCase):
def setUp(self):
self.old_compress_url = settings.COMPRESS_URL
settings.COMPRESS_URL = 'http://localhost/static/'
def test_individual_url(self):
"""Check that individual URL is correctly generated"""
packager = Packager()
filename = os.path.join(settings.COMPRESS_ROOT, u'js/application.js')
individual_url = packager.individual_url(filename)
self.assertEqual(individual_url,
"http://localhost/static/js/application.js")
def tearDown(self):
settings.COMPRESS_URL = self.old_compress_url
from django.test import TestCase
class VersioningTest(TestCase):
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment