From feb8ca44677894ec37f21ae4d7bc9a93dc94dd4e Mon Sep 17 00:00:00 2001 From: tasawernawaz Date: Tue, 31 May 2016 14:36:19 +0000 Subject: [PATCH] Revert "ECOM-4334 Update learner dashboard" This reverts commit caa5a0ac02e84ee7f1c003760a30c3d5c8b9a0fb. --- common/test/acceptance/pages/lms/dashboard.py | 6 --- .../tests/lms/test_learner_profile.py | 10 +++-- .../student_account/test/test_views.py | 25 ++--------- lms/djangoapps/student_account/views.py | 2 - .../student_profile/test/test_views.py | 28 ++---------- lms/djangoapps/student_profile/views.py | 2 - lms/templates/navigation.html | 22 +++------- lms/templates/user_dropdown.html | 12 ++--- themes/edx.org/lms/templates/header.html | 44 +++++++++---------- 9 files changed, 48 insertions(+), 103 deletions(-) diff --git a/common/test/acceptance/pages/lms/dashboard.py b/common/test/acceptance/pages/lms/dashboard.py index ccad73d953..29d5ab928a 100644 --- a/common/test/acceptance/pages/lms/dashboard.py +++ b/common/test/acceptance/pages/lms/dashboard.py @@ -174,12 +174,6 @@ class DashboardPage(PageObject): """ self.q(css='.dropdown').first.click() - def click_username(self): - """ - Click username. - """ - self.q(css='.label-username').first.click() - @property def username_dropdown_link_text(self): """ diff --git a/common/test/acceptance/tests/lms/test_learner_profile.py b/common/test/acceptance/tests/lms/test_learner_profile.py index 3881c06478..72ec3c6431 100644 --- a/common/test/acceptance/tests/lms/test_learner_profile.py +++ b/common/test/acceptance/tests/lms/test_learner_profile.py @@ -266,17 +266,21 @@ class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest): def test_dashboard_learner_profile_link(self): """ - Scenario: Verify that when user click on username it will leads to profile page. + Scenario: Verify that my profile link is present on dashboard page and we can navigate to correct page. Given that I am a registered user. When I go to Dashboard page. - And I click on username. + And I click on username dropdown. + Then I see Profile link in the dropdown menu. + When I click on Profile link. Then I will be navigated to Profile page. """ username, user_id = self.log_in_as_unique_user() dashboard_page = DashboardPage(self.browser) dashboard_page.visit() - dashboard_page.click_username() + dashboard_page.click_username_dropdown() + self.assertIn('Profile', dashboard_page.username_dropdown_link_text) + dashboard_page.click_my_profile_link() my_profile_page = LearnerProfilePage(self.browser, username) my_profile_page.wait_for_page() diff --git a/lms/djangoapps/student_account/test/test_views.py b/lms/djangoapps/student_account/test/test_views.py index 3b810796bc..4482d54341 100644 --- a/lms/djangoapps/student_account/test/test_views.py +++ b/lms/djangoapps/student_account/test/test_views.py @@ -19,7 +19,6 @@ from django.test.utils import override_settings from django.http import HttpRequest from course_modes.models import CourseMode -from openedx.core.djangoapps.programs.tests.mixins import ProgramsApiConfigMixin from openedx.core.djangoapps.user_api.accounts.api import activate_account, create_account from openedx.core.djangoapps.user_api.accounts import EMAIL_MAX_LENGTH from openedx.core.djangolib.js_utils import dump_js_escaped_json @@ -443,7 +442,7 @@ class StudentAccountLoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMi }) -class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase, ProgramsApiConfigMixin): +class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase): """ Tests for the account settings view. """ USERNAME = 'student' @@ -457,7 +456,6 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase, ProgramsApiConf 'year_of_birth', 'preferred_language', ] - view_path = reverse('account_settings') @mock.patch("django.conf.settings.MESSAGE_STORAGE", 'django.contrib.messages.storage.cookie.CookieStorage') def setUp(self): @@ -504,29 +502,12 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase, ProgramsApiConf def test_view(self): - response = self.client.get(path=self.view_path) + view_path = reverse('account_settings') + response = self.client.get(path=view_path) for attribute in self.FIELDS: self.assertIn(attribute, response.content) - def test_header_with_programs_listing_enabled(self): - """ - Verify that tabs header will be shown while program listing is enabled. - """ - self.create_programs_config(program_listing_enabled=True) - response = self.client.get(path=self.view_path) - - self.assertContains(response, '
  • ') - - def test_header_with_programs_listing_disabled(self): - """ - Verify that nav header will be shown while program listing is disabled. - """ - self.create_programs_config(program_listing_enabled=False) - response = self.client.get(path=self.view_path) - - self.assertContains(response, '
  • ') - - def test_header_with_programs_listing_disabled(self): - """ - Verify that nav header will be shown while program listing is disabled. - """ - self.create_programs_config(program_listing_enabled=False) - profile_path = reverse('learner_profile', kwargs={'username': self.USERNAME}) - response = self.client.get(path=profile_path) - - self.assertContains(response, '