Account settings page
unawaz/ECOM-4787-account-settings-page-header
This commit is contained in:
@@ -436,6 +436,7 @@ def account_settings_context(request):
|
||||
context = {
|
||||
'auth': {},
|
||||
'duplicate_provider': None,
|
||||
'nav_hidden': True,
|
||||
'fields': {
|
||||
'country': {
|
||||
'options': list(countries),
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
import unittest
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase, override_settings
|
||||
from django.contrib import staticfiles
|
||||
|
||||
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')
|
||||
@@ -21,10 +23,15 @@ class TestComprehensiveThemeLMS(TestCase):
|
||||
Clear static file finders cache and register cleanup methods.
|
||||
"""
|
||||
super(TestComprehensiveThemeLMS, self).setUp()
|
||||
self.user = UserFactory()
|
||||
|
||||
# Clear the internal staticfiles caches, to get test isolation.
|
||||
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")
|
||||
def test_footer(self):
|
||||
"""
|
||||
@@ -35,6 +42,21 @@ class TestComprehensiveThemeLMS(TestCase):
|
||||
# This string comes from header.html of 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")
|
||||
def test_logo_image(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user