Commit 733cf06c by Umar Nawaz Committed by GitHub

Merge pull request #13005 from edx/unawaz/ECOM-4787-account-settings-page-header

unawaz/ECOM-4787-account-settings-page-header
parents f0644abe 5f8bb35f
...@@ -436,6 +436,7 @@ def account_settings_context(request): ...@@ -436,6 +436,7 @@ def account_settings_context(request):
context = { context = {
'auth': {}, 'auth': {},
'duplicate_provider': None, 'duplicate_provider': None,
'nav_hidden': True,
'fields': { 'fields': {
'country': { 'country': {
'options': list(countries), 'options': list(countries),
......
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
import unittest import unittest
from django.conf import settings from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings from django.test import TestCase, override_settings
from django.contrib import staticfiles from django.contrib import staticfiles
from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme
from student.tests.factories import UserFactory
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
...@@ -21,10 +23,15 @@ class TestComprehensiveThemeLMS(TestCase): ...@@ -21,10 +23,15 @@ class TestComprehensiveThemeLMS(TestCase):
Clear static file finders cache and register cleanup methods. Clear static file finders cache and register cleanup methods.
""" """
super(TestComprehensiveThemeLMS, self).setUp() super(TestComprehensiveThemeLMS, self).setUp()
self.user = UserFactory()
# Clear the internal staticfiles caches, to get test isolation. # Clear the internal staticfiles caches, to get test isolation.
staticfiles.finders.get_finder.cache_clear() staticfiles.finders.get_finder.cache_clear()
def _login(self):
""" Log into LMS. """
self.client.login(username=self.user.username, password='test')
@with_comprehensive_theme("test-theme") @with_comprehensive_theme("test-theme")
def test_footer(self): def test_footer(self):
""" """
...@@ -35,6 +42,21 @@ class TestComprehensiveThemeLMS(TestCase): ...@@ -35,6 +42,21 @@ class TestComprehensiveThemeLMS(TestCase):
# This string comes from header.html of test-theme # This string comes from header.html of test-theme
self.assertContains(resp, "This is a footer for test-theme.") self.assertContains(resp, "This is a footer for test-theme.")
@with_comprehensive_theme("edx.org")
def test_account_settings_hide_nav(self):
"""
Test that theme header doesn't show marketing site links for Account Settings page.
"""
self._login()
account_settings_url = reverse('account_settings')
response = self.client.get(account_settings_url)
# Verify that the header navigation links are hidden for the edx.org version
self.assertNotContains(response, "How it Works")
self.assertNotContains(response, "Find courses")
self.assertNotContains(response, "Schools & Partners")
@with_comprehensive_theme("test-theme") @with_comprehensive_theme("test-theme")
def test_logo_image(self): def test_logo_image(self):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment