TNL-4895 User dropdown reflects real user
Exposes real_user to the user_dropdown template, allowing for the requested feature change of keeping the profile links pointed at the real user's profile.
This commit is contained in:
@@ -149,6 +149,18 @@ class MasqueradeTestCase(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
|
||||
self.assertIn(self.problem_display_name, problem_html)
|
||||
self.assertEqual(show_answer_expected, "Show Answer" in problem_html)
|
||||
|
||||
def verify_original_user_profile_link(self):
|
||||
"""
|
||||
Verifies that the 'Profile' link in the navigation dropdown is pointing
|
||||
to the original user.
|
||||
"""
|
||||
content = self.get_courseware_page().content
|
||||
self.assertIn(
|
||||
'<a href="/u/{}" class="action dropdown-menuitem">Profile</a>'.format(self.test_user.username),
|
||||
content,
|
||||
"Profile link should point to original user",
|
||||
)
|
||||
|
||||
|
||||
@attr(shard=1)
|
||||
class NormalStudentVisibilityTest(MasqueradeTestCase):
|
||||
@@ -326,6 +338,9 @@ class TestStaffMasqueradeAsSpecificStudent(StaffMasqueradeTestCase, ProblemSubmi
|
||||
self.update_masquerade(role='student', user_name=self.student_user.username)
|
||||
self.assertEqual(self.get_progress_detail(), u'2/2')
|
||||
|
||||
# Verify that the user dropdown links have not changed
|
||||
self.verify_original_user_profile_link()
|
||||
|
||||
# Temporarily override the student state.
|
||||
self.submit_answer('Correct', 'Incorrect')
|
||||
self.assertEqual(self.get_progress_detail(), u'1/2')
|
||||
|
||||
Reference in New Issue
Block a user