22import os
33from collections .abc import Iterable
44
5- import django
65import pytest
76from django .db .models import QuerySet
87from django .urls import reverse
@@ -751,7 +750,7 @@ def test_widgets_selected_after_validation_error(
751750 assert len (city_names_from_browser ) != City .objects .count ()
752751 assert city_names_from_browser == city_names_from_db
753752
754- # selecting a city reaaly does it
753+ # selecting a city really does it
755754 city_option = driver .find_element (
756755 By .CSS_SELECTOR , ".select2-results li:nth-child(2)"
757756 )
@@ -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,38 +866,10 @@ 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 ) == (
875872 "admin/js/vendor/select2/select2.full.min.js" ,
876873 "admin/js/vendor/select2/i18n/fr.js" ,
877874 "django_select2/django_select2.js" ,
878875 )
879-
880-
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- )
891- def test_i18n_name_property_with_country_code_in_locale_for_older_django (
892- widget , locale , expected
893- ):
894- """No fallback for locale with an unsupported country code."""
895- with translation .override (locale ):
896- 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