mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Cut test time by 65% by caching templates and not compiling sass
This commit is contained in:
@@ -18,9 +18,16 @@ atexit.register(tmpdir.cleanup)
|
|||||||
EMAIL_BACKEND = 'django.core.mail.outbox'
|
EMAIL_BACKEND = 'django.core.mail.outbox'
|
||||||
|
|
||||||
COMPRESS_ENABLED = COMPRESS_OFFLINE = False
|
COMPRESS_ENABLED = COMPRESS_OFFLINE = False
|
||||||
|
COMPRESS_CACHE_BACKEND = 'testcache'
|
||||||
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
|
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
|
||||||
PRETIX_INSTANCE_NAME = 'pretix.eu'
|
PRETIX_INSTANCE_NAME = 'pretix.eu'
|
||||||
|
|
||||||
|
COMPRESS_PRECOMPILERS_ORIGINAL = COMPRESS_PRECOMPILERS
|
||||||
|
COMPRESS_PRECOMPILERS = ()
|
||||||
|
TEMPLATES[0]['OPTIONS']['loaders'] = (
|
||||||
|
('django.template.loaders.cached.Loader', template_loaders),
|
||||||
|
)
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
DEBUG_PROPAGATE_EXCEPTIONS = True
|
DEBUG_PROPAGATE_EXCEPTIONS = True
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from decimal import Decimal
|
|||||||
|
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test import TestCase
|
from django.test import TestCase, override_settings
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
|
|
||||||
@@ -261,6 +261,7 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
|||||||
"itemnum": 0,
|
"itemnum": 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override_settings(COMPRESS_PRECOMPILERS=settings.COMPRESS_PRECOMPILERS_ORIGINAL)
|
||||||
def test_css_customized(self):
|
def test_css_customized(self):
|
||||||
response = self.client.get('/%s/%s/widget/v1.css' % (self.orga.slug, self.event.slug))
|
response = self.client.get('/%s/%s/widget/v1.css' % (self.orga.slug, self.event.slug))
|
||||||
c = b"".join(response.streaming_content).decode()
|
c = b"".join(response.streaming_content).decode()
|
||||||
|
|||||||
Reference in New Issue
Block a user