22import os
33from collections .abc import Iterable
44
5- import django
65import pytest
76from django .db .models import QuerySet
87from django .urls import reverse
@@ -851,7 +850,6 @@ def widget_fixture(request):
851850 return widget_class (** widget_kwargs )
852851
853852
854- @pytest .mark .skipif (django .VERSION < (4 , 1 ), reason = "Only for Django 4.1+" )
855853@pytest .mark .parametrize (
856854 "locale,expected" ,
857855 [
@@ -868,7 +866,6 @@ def test_i18n_name_property_with_country_code_in_locale(widget, locale, expected
868866 assert widget .i18n_name == expected
869867
870868
871- @pytest .mark .skipif (django .VERSION < (4 , 1 ), reason = "Only for Django 4.1+" )
872869def test_i18n_media_js_with_country_code_in_locale (widget ):
873870 translation .activate ("fr-FR" )
874871 assert tuple (widget .media ._js ) == (
@@ -878,28 +875,9 @@ def test_i18n_media_js_with_country_code_in_locale(widget):
878875 )
879876
880877
881- @pytest .mark .skipif (django .VERSION >= (4 , 1 ), reason = "Only for Django 4.0 and previous" )
882- @pytest .mark .parametrize (
883- "locale,expected" ,
884- [
885- ("fr-FR" , None ),
886- # Some locales with a country code are natively supported by select2's i18n
887- ("pt-BR" , "pt-BR" ),
888- ("sr-Cyrl" , "sr-Cyrl" ),
889- ],
890- )
891878def test_i18n_name_property_with_country_code_in_locale_for_older_django (
892879 widget , locale , expected
893880):
894881 """No fallback for locale with an unsupported country code."""
895882 with translation .override (locale ):
896883 assert widget .i18n_name == expected
897-
898-
899- @pytest .mark .skipif (django .VERSION >= (4 , 1 ), reason = "Only for Django 4.0 and previous" )
900- def test_i18n_media_js_with_country_code_in_locale_for_older_django (widget ):
901- translation .activate ("fr-FR" )
902- assert tuple (widget .media ._js ) == (
903- "admin/js/vendor/select2/select2.full.min.js" ,
904- "django_select2/django_select2.js" ,
905- )
0 commit comments