From 5b29672ed1d4fb378dac3ae0d6a1dffdba2f6782 Mon Sep 17 00:00:00 2001 From: Nimisha Asthagiri Date: Wed, 29 May 2019 02:20:42 -0400 Subject: [PATCH] Remove microsites from user_authn DEPR-30 --- .../user_authn/views/tests/test_register.py | 28 ++++--------------- 1 file changed, 5 insertions(+), 23 deletions(-) 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 751df621fc57..273d0d1ef986 100644 --- a/openedx/core/djangoapps/user_authn/views/tests/test_register.py +++ b/openedx/core/djangoapps/user_authn/views/tests/test_register.py @@ -22,6 +22,7 @@ from openedx.core.djangoapps.django_comment_common.models import ForumsConfig from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY from openedx.core.djangoapps.site_configuration.tests.mixins import SiteMixin +from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration from openedx.core.djangoapps.user_api.accounts import ( USERNAME_BAD_LENGTH_MSG, USERNAME_INVALID_CHARS_ASCII, @@ -78,13 +79,10 @@ def get_mock_pipeline_data(username=TEST_USERNAME, email=TEST_EMAIL): @ddt.ddt +@with_site_configuration( + configuration={"extended_profile_fields": ["extra1", "extra2"]} +) @override_settings( - MICROSITE_CONFIGURATION={ - "microsite": { - "domain_prefix": "microsite", - "extended_profile_fields": ["extra1", "extra2"], - } - }, REGISTRATION_EXTRA_FIELDS={ key: "optional" for key in [ @@ -125,7 +123,7 @@ def test_header_lang_pref_saved(self, lang): self.assertEqual(response.status_code, 200) self.assertEqual(get_user_preference(user, LANGUAGE_KEY), lang) - def create_account_and_fetch_profile(self, host='microsite.example.com'): + def create_account_and_fetch_profile(self, host='test.localhost'): """ Create an account with self.params, assert that the response indicates success, and return the UserProfile object for the newly created user @@ -157,10 +155,6 @@ def test_marketing_cookie(self): self.assertIn(settings.EDXMKTG_LOGGED_IN_COOKIE_NAME, self.client.cookies) self.assertIn(settings.EDXMKTG_USER_INFO_COOKIE_NAME, self.client.cookies) - @unittest.skipUnless( - "microsite_configuration.middleware.MicrositeMiddleware" in settings.MIDDLEWARE_CLASSES, - "Microsites not implemented in this environment" - ) def test_profile_saved_no_optional_fields(self): profile = self.create_account_and_fetch_profile() self.assertEqual(profile.name, self.params["name"]) @@ -179,10 +173,6 @@ def test_profile_saved_no_optional_fields(self): ) self.assertIsNone(profile.year_of_birth) - @unittest.skipUnless( - "microsite_configuration.middleware.MicrositeMiddleware" in settings.MIDDLEWARE_CLASSES, - "Microsites not implemented in this environment" - ) @override_settings(LMS_SEGMENT_KEY="testkey") @mock.patch('openedx.core.djangoapps.user_authn.views.register.segment.track') @mock.patch('openedx.core.djangoapps.user_authn.views.register.segment.identify') @@ -217,10 +207,6 @@ def test_segment_tracking(self, mock_segment_identify, _): mock_segment_identify.assert_called_with(profile.user.id, expected_payload) - @unittest.skipUnless( - "microsite_configuration.middleware.MicrositeMiddleware" in settings.MIDDLEWARE_CLASSES, - "Microsites not implemented in this environment" - ) def test_profile_saved_all_optional_fields(self): self.params.update({ "level_of_education": "a", @@ -249,10 +235,6 @@ def test_profile_saved_all_optional_fields(self): ) self.assertEqual(profile.year_of_birth, 2015) - @unittest.skipUnless( - "microsite_configuration.middleware.MicrositeMiddleware" in settings.MIDDLEWARE_CLASSES, - "Microsites not implemented in this environment" - ) def test_profile_saved_empty_optional_fields(self): self.params.update({ "level_of_education": "",