From cd896501ca00c483f27f52a4fa1c2b2738816a4a Mon Sep 17 00:00:00 2001 From: asadiqbal Date: Thu, 8 Jun 2017 17:42:43 +0500 Subject: [PATCH] ENT-368 --- lms/djangoapps/student_account/test/test_views.py | 8 ++++---- lms/djangoapps/student_account/views.py | 1 + lms/templates/navigation.html | 4 ++-- themes/edx.org/lms/templates/header.html | 5 +++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lms/djangoapps/student_account/test/test_views.py b/lms/djangoapps/student_account/test/test_views.py index 10b5baa40d..12966e747b 100644 --- a/lms/djangoapps/student_account/test/test_views.py +++ b/lms/djangoapps/student_account/test/test_views.py @@ -328,19 +328,19 @@ class StudentAccountLoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMi ("edx.org", "register_user"), ) @ddt.unpack - def test_login_and_registration_form_signin_preserves_params(self, theme, url_name): + def test_login_and_registration_form_signin_not_preserves_params(self, theme, url_name): params = [ ('course_id', 'edX/DemoX/Demo_Course'), ('enrollment_action', 'enroll'), ] - # The response should have a "Sign In" button with the URL + # The response should not have a "Sign In" button with the URL # that preserves the querystring params with with_comprehensive_theme_context(theme): response = self.client.get(reverse(url_name), params, HTTP_ACCEPT="text/html") expected_url = '/login?{}'.format(self._finish_auth_url_param(params + [('next', '/dashboard')])) - self.assertContains(response, expected_url) + self.assertNotContains(response, expected_url) # Add additional parameters: params = [ @@ -356,7 +356,7 @@ class StudentAccountLoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMi response = self.client.get(reverse(url_name), params, HTTP_ACCEPT="text/html") expected_url = '/login?{}'.format(self._finish_auth_url_param(params)) - self.assertContains(response, expected_url) + self.assertNotContains(response, expected_url) @mock.patch.dict(settings.FEATURES, {"ENABLE_THIRD_PARTY_AUTH": False}) @ddt.data("signin_user", "register_user") diff --git a/lms/djangoapps/student_account/views.py b/lms/djangoapps/student_account/views.py index 0a6da26076..f7c35463c2 100644 --- a/lms/djangoapps/student_account/views.py +++ b/lms/djangoapps/student_account/views.py @@ -141,6 +141,7 @@ def login_and_registration_form(request, initial_mode="login"): 'responsive': True, 'allow_iframing': True, 'disable_courseware_js': True, + 'combined_login_and_register': True, 'disable_footer': not configuration_helpers.get_value( 'ENABLE_COMBINED_LOGIN_REGISTRATION_FOOTER', settings.FEATURES['ENABLE_COMBINED_LOGIN_REGISTRATION_FOOTER'] diff --git a/lms/templates/navigation.html b/lms/templates/navigation.html index fb0dde5f44..649fe70bc9 100644 --- a/lms/templates/navigation.html +++ b/lms/templates/navigation.html @@ -136,7 +136,7 @@ site_status_msg = get_site_status_msg(course_id) <%block name="navigation_other_global_links"> - % if not settings.FEATURES['DISABLE_LOGIN_BUTTON']: + % if not settings.FEATURES['DISABLE_LOGIN_BUTTON'] and not combined_login_and_register: % if settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'):