diff --git a/django_select2/conf.py b/django_select2/conf.py index 0afab20c..2b62e096 100644 --- a/django_select2/conf.py +++ b/django_select2/conf.py @@ -56,7 +56,7 @@ class Select2Conf(AppConf): It has set `select2_` as a default value, which you can change if needed. """ - JS = '//cdnjs.cloudflare.com/ajax/libs/select2/{version}/js/select2.min.js'.format(version=LIB_VERSION) + JS = 'https://cdnjs.cloudflare.com/ajax/libs/select2/{version}/js/select2.min.js'.format(version=LIB_VERSION) """ The URI for the Select2 JS file. By default this points to the Cloudflare CDN. @@ -74,7 +74,7 @@ class Select2Conf(AppConf): develop without an Internet connection. """ - CSS = '//cdnjs.cloudflare.com/ajax/libs/select2/{version}/css/select2.min.css'.format(version=LIB_VERSION) + CSS = 'https://cdnjs.cloudflare.com/ajax/libs/select2/{version}/css/select2.min.css'.format(version=LIB_VERSION) """ The URI for the Select2 CSS file. By default this points to the Cloudflare CDN. @@ -92,7 +92,7 @@ class Select2Conf(AppConf): develop without an Internet connection. """ - I18N_PATH = '//cdnjs.cloudflare.com/ajax/libs/select2/{version}/js/i18n'.format(version=LIB_VERSION) + I18N_PATH = 'https://cdnjs.cloudflare.com/ajax/libs/select2/{version}/js/i18n'.format(version=LIB_VERSION) """ The base URI for the Select2 i18n files. By default this points to the Cloudflare CDN. diff --git a/tests/test_forms.py b/tests/test_forms.py index f994ae43..9671cb23 100644 --- a/tests/test_forms.py +++ b/tests/test_forms.py @@ -102,28 +102,28 @@ def test_empty_option(self, db): def test_i18n(self): translation.activate('de') assert tuple(Select2Widget().media._js) == ( - f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', - f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/i18n/de.js', + f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', + f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/i18n/de.js', 'django_select2/django_select2.js' ) translation.activate('en') assert tuple(Select2Widget().media._js) == ( - f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', - f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/i18n/en.js', + f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', + f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/i18n/en.js', 'django_select2/django_select2.js' ) translation.activate('00') assert tuple(Select2Widget().media._js) == ( - f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', + f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', 'django_select2/django_select2.js' ) translation.activate('sr-cyrl') assert tuple(Select2Widget().media._js) == ( - f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', - f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/i18n/sr-Cyrl.js', + f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', + f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/i18n/sr-Cyrl.js', 'django_select2/django_select2.js' ) @@ -131,15 +131,15 @@ def test_i18n(self): translation.activate('zh-hans') assert tuple(Select2Widget().media._js) == ( - f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', - f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/i18n/zh-CN.js', + f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', + f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/i18n/zh-CN.js', 'django_select2/django_select2.js' ) translation.activate('zh-hant') assert tuple(Select2Widget().media._js) == ( - f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', - f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/i18n/zh-TW.js', + f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js', + f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/i18n/zh-TW.js', 'django_select2/django_select2.js' ) @@ -148,8 +148,8 @@ class TestSelect2MixinSettings: def test_default_media(self): sut = Select2Widget() result = sut.media.render() - assert f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js' in result - assert f'//cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/css/select2.min.css' in result + assert f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/js/select2.min.js' in result + assert f'https://cdnjs.cloudflare.com/ajax/libs/select2/{settings.SELECT2_LIB_VERSION}/css/select2.min.css' in result assert 'django_select2/django_select2.js' in result def test_js_setting(self, settings): diff --git a/tests/testapp/templates/form.html b/tests/testapp/templates/form.html index c57d0cf2..7499bc8e 100644 --- a/tests/testapp/templates/form.html +++ b/tests/testapp/templates/form.html @@ -15,7 +15,7 @@ {{ form }} - +