Skip to content

Commit

Permalink
Merge pull request openedx#20708 from edx/depr/microsites-user_authn
Browse files Browse the repository at this point in the history
Remove microsites from user_authn
  • Loading branch information
nasthagiri authored May 29, 2019
2 parents 1bb449a + 5b29672 commit 5c3dbaa
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions openedx/core/djangoapps/user_authn/views/tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 [
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"])
Expand All @@ -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')
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": "",
Expand Down

0 comments on commit 5c3dbaa

Please sign in to comment.