Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Import the config early to make sure @override_settings doesn't break
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Mar 11, 2016
1 parent c823ffb commit edea658
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions systemjs/__init__.py
Expand Up @@ -10,6 +10,9 @@
VERSION = (1, 1, 0, 'final', 0)


default_app_config = 'systemjs.apps.SystemJSConfig'


def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
version = get_complete_version(version)
Expand Down
12 changes: 12 additions & 0 deletions systemjs/apps.py
@@ -0,0 +1,12 @@
from __future__ import absolute_import, unicode_literals

from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _


class SystemJSConfig(AppConfig):
name = 'systemjs'
verbose_name = _('Django SystemJS')

def ready(self):
from . import conf # noqa
2 changes: 1 addition & 1 deletion systemjs/templatetags/system_tags.py
Expand Up @@ -3,9 +3,9 @@
import posixpath

from django import template
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage

from systemjs.conf import settings
from systemjs.base import System

register = template.Library()
Expand Down
2 changes: 1 addition & 1 deletion tests/settings.py
Expand Up @@ -12,7 +12,7 @@

ROOT_URLCONF = 'tests.urls'

DEBUG = True
DEBUG = False
STATIC_URL = '/static/'
SECRET_KEY = 'this-is-really-not-a-secret'

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test_templatetags.py
Expand Up @@ -25,7 +25,7 @@ def test_debug(self):
rendered = self._render()
self.assertEqual(rendered, """<script type="text/javascript">System.import('myapp/main.js');</script>""")

@override_settings(SYSTEMJS_OUTPUT_DIR='SJ')
@override_settings(SYSTEMJS_ENABLED=True, SYSTEMJS_OUTPUT_DIR='SJ')
def test_normal(self):
rendered = self._render()
expected_url = urljoin(settings.STATIC_URL, 'SJ/myapp/main.js')
Expand Down

0 comments on commit edea658

Please sign in to comment.