2
2
import os
3
3
from collections .abc import Iterable
4
4
5
- import django
6
5
import pytest
7
6
from django .db .models import QuerySet
8
7
from django .urls import reverse
@@ -751,7 +750,7 @@ def test_widgets_selected_after_validation_error(
751
750
assert len (city_names_from_browser ) != City .objects .count ()
752
751
assert city_names_from_browser == city_names_from_db
753
752
754
- # selecting a city reaaly does it
753
+ # selecting a city really does it
755
754
city_option = driver .find_element (
756
755
By .CSS_SELECTOR , ".select2-results li:nth-child(2)"
757
756
)
@@ -851,7 +850,6 @@ def widget_fixture(request):
851
850
return widget_class (** widget_kwargs )
852
851
853
852
854
- @pytest .mark .skipif (django .VERSION < (4 , 1 ), reason = "Only for Django 4.1+" )
855
853
@pytest .mark .parametrize (
856
854
"locale,expected" ,
857
855
[
@@ -868,38 +866,10 @@ def test_i18n_name_property_with_country_code_in_locale(widget, locale, expected
868
866
assert widget .i18n_name == expected
869
867
870
868
871
- @pytest .mark .skipif (django .VERSION < (4 , 1 ), reason = "Only for Django 4.1+" )
872
869
def test_i18n_media_js_with_country_code_in_locale (widget ):
873
870
translation .activate ("fr-FR" )
874
871
assert tuple (widget .media ._js ) == (
875
872
"admin/js/vendor/select2/select2.full.min.js" ,
876
873
"admin/js/vendor/select2/i18n/fr.js" ,
877
874
"django_select2/django_select2.js" ,
878
875
)
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