Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Improve test suite
Artur Smęta2b6468a2b5d
diff --git a/tests/test_userprofile.py b/tests/test_userprofile.pyindex 3cebdb5de0..2a39589c84 100644--- a/tests/test_userprofile.py+++ b/tests/test_userprofile.py@@ -7,8 +7,7 @@ import i18naddressimport pytestfrom django.http import QueryDict-from saleor.userprofile import forms, models-+from saleor.userprofile import forms, models, i18n@pytest.fixturedef billing_address(db):@@ -89,3 +88,15 @@ def test_get_address_form(form_data, form_valid, expected_preview, expected_counassert preview is expected_previewassert form.is_valid() is form_validassert form.i18n_country_code == expected_country+++def test_country_aware_form_has_only_supported_countries():++ default_form = i18n.COUNTRY_FORMS['US']+ instance = default_form()+ country_field = instance.fields['country']+ country_choices = [code for code, label in country_field.choices]++ for country in i18n.UNKNOWN_COUNTRIES:+ assert country not in i18n.COUNTRY_FORMS+ assert country not in country_choices