From d81af828fb507b02bc01f48f1acd354756f27ac7 Mon Sep 17 00:00:00 2001 From: aarif Date: Thu, 12 Dec 2019 13:31:43 +0500 Subject: [PATCH] updated the django-countries to version that supports django 2.2 updated the tests minor changes changes made verify capitalized country code changes made verify capitalized country code changes made stay consistent with country code implementation changes made to test with previous implementation updated the django-countries version to latest updated the tests input to match the output updated the constants to use updated country names according to new ISO standards --- .../djangoapps/student/tests/test_user_profile_properties.py | 2 +- openedx/core/djangoapps/user_api/tests/test_constants.py | 4 ++-- .../core/djangoapps/user_authn/views/tests/test_register.py | 2 +- requirements/edx/base.in | 2 +- requirements/edx/base.txt | 2 +- requirements/edx/development.txt | 2 +- requirements/edx/testing.txt | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/djangoapps/student/tests/test_user_profile_properties.py b/common/djangoapps/student/tests/test_user_profile_properties.py index 960f35432e..9b9a4214e3 100644 --- a/common/djangoapps/student/tests/test_user_profile_properties.py +++ b/common/djangoapps/student/tests/test_user_profile_properties.py @@ -90,7 +90,7 @@ class UserProfilePropertiesTest(CacheIsolationTestCase): def test_invalidate_cache_user_profile_country_updated(self): - country = 'us' + country = 'US' self.profile.country = country self.profile.save() diff --git a/openedx/core/djangoapps/user_api/tests/test_constants.py b/openedx/core/djangoapps/user_api/tests/test_constants.py index 332eb73117..012591627d 100644 --- a/openedx/core/djangoapps/user_api/tests/test_constants.py +++ b/openedx/core/djangoapps/user_api/tests/test_constants.py @@ -71,6 +71,7 @@ SORTED_COUNTRIES = [ (u"GQ", u"Equatorial Guinea"), (u"ER", u"Eritrea"), (u"EE", u"Estonia"), + (u"SZ", u"Eswatini"), (u"ET", u"Ethiopia"), (u"FK", u"Falkland Islands [Malvinas]"), (u"FO", u"Faroe Islands"), @@ -131,7 +132,6 @@ SORTED_COUNTRIES = [ (u"LT", u"Lithuania"), (u"LU", u"Luxembourg"), (u"MO", u"Macao"), - (u"MK", u"Macedonia"), (u"MG", u"Madagascar"), (u"MW", u"Malawi"), (u"MY", u"Malaysia"), @@ -165,6 +165,7 @@ SORTED_COUNTRIES = [ (u"NU", u"Niue"), (u"NF", u"Norfolk Island"), (u"KP", u"North Korea"), + (u"MK", u"North Macedonia"), (u"MP", u"Northern Mariana Islands"), (u"NO", u"Norway"), (u"OM", u"Oman"), @@ -215,7 +216,6 @@ SORTED_COUNTRIES = [ (u"SD", u"Sudan"), (u"SR", u"Suriname"), (u"SJ", u"Svalbard and Jan Mayen"), - (u"SZ", u"Swaziland"), (u"SE", u"Sweden"), (u"CH", u"Switzerland"), (u"SY", u"Syria"), diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_register.py b/openedx/core/djangoapps/user_authn/views/tests/test_register.py index 04f6f3976e..b4e8cce991 100644 --- a/openedx/core/djangoapps/user_authn/views/tests/test_register.py +++ b/openedx/core/djangoapps/user_authn/views/tests/test_register.py @@ -302,7 +302,7 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase): YEAR_OF_BIRTH = "1998" ADDRESS = "123 Fake Street" CITY = "Springfield" - COUNTRY = "us" + COUNTRY = "US" GOALS = "Learn all the things!" PROFESSION_OPTIONS = [ { diff --git a/requirements/edx/base.in b/requirements/edx/base.in index def05a9d29..b3e3e14321 100644 --- a/requirements/edx/base.in +++ b/requirements/edx/base.in @@ -40,7 +40,7 @@ Django<1.12 # Web application framework django-babel-underscore # underscore template extractor for django-babel (internationalization utilities) django-config-models>=1.0.0 # Configuration models for Django allowing config management with auditing django-cors-headers==2.5.3 # Used to allow to configure CORS headers for cross-domain requests -django-countries==4.6.1 # Country data for Django forms and model fields +django-countries # Country data for Django forms and model fields django-crum # Middleware that stores the current request and user in thread local storage django-fernet-fields # via edx-enterprise (should be added to its setup.py) django-filter==1.0.4 # Allows users to filter Django querysets dynamically diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 49f7cab416..4b132c923d 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -59,7 +59,7 @@ git+https://github.com/edx/django-celery.git@756cb57aad765cb2b0d37372c1855b8f5f3 django-classy-tags==0.9.0 # via django-sekizai django-config-models==1.0.3 django-cors-headers==2.5.3 -django-countries==4.6.1 +django-countries==5.5 django-crum==0.7.5 django-fernet-fields==0.6 django-filter==1.0.4 diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index f437b49388..7f82c880b4 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -79,7 +79,7 @@ git+https://github.com/edx/django-celery.git@756cb57aad765cb2b0d37372c1855b8f5f3 django-classy-tags==0.9.0 django-config-models==1.0.3 django-cors-headers==2.5.3 -django-countries==4.6.1 +django-countries==5.5 django-crum==0.7.5 django-debug-toolbar==1.11 django-fernet-fields==0.6 diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 9ef79899f7..da2175c052 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -78,7 +78,7 @@ git+https://github.com/edx/django-celery.git@756cb57aad765cb2b0d37372c1855b8f5f3 django-classy-tags==0.9.0 django-config-models==1.0.3 django-cors-headers==2.5.3 -django-countries==4.6.1 +django-countries==5.5 django-crum==0.7.5 django-fernet-fields==0.6 django-filter==1.0.4