Commit 282ded74 by Albert St. Aubin

Addressed test failures and PR comments

TNL-5894
parent cb22b909
...@@ -20,7 +20,7 @@ class CourseInfoPage(CoursePage): ...@@ -20,7 +20,7 @@ class CourseInfoPage(CoursePage):
""" """
Return the number of updates on the page. Return the number of updates on the page.
""" """
return len(self.q(css='section.updates section article').results) return len(self.q(css='.updates .updates-article').results)
@property @property
def handout_links(self): def handout_links(self):
......
...@@ -216,15 +216,15 @@ class CourseInfoTitleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): ...@@ -216,15 +216,15 @@ class CourseInfoTitleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
) )
self.assertIn( self.assertIn(
expected_title, expected_title,
content('h1.page-title').contents() content('.page-title').contents()[0]
) )
self.assertIn( self.assertIn(
expected_display_title, expected_display_title,
display_content('h1.page-title').contents() display_content('.page-title').contents()[0]
) )
self.assertIn( self.assertIn(
display_course.display_name_with_default, display_course.display_name_with_default,
display_content('h2.page-subtitle').contents() display_content('.page-subtitle').contents()
) )
......
...@@ -180,7 +180,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase): ...@@ -180,7 +180,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase):
self.client.login(username='mrrobot', password='test') self.client.login(username='mrrobot', password='test')
html_elements = [ html_elements = [
'<h1 class="handouts-header">Important Course Dates</h1>', '<h4 class="handouts-header">Important Course Dates</h4>',
'<div class="date-summary-container">', '<div class="date-summary-container">',
'<div class="date-summary date-summary-todays-date">', '<div class="date-summary date-summary-todays-date">',
'<h3 class="heading localized-datetime"', '<h3 class="heading localized-datetime"',
...@@ -202,7 +202,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase): ...@@ -202,7 +202,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase):
response = self.client.get(url) response = self.client.get(url)
html_elements = [ html_elements = [
'<h1 class="handouts-header">Important Course Dates</h1>', '<h4 class="handouts-header">Important Course Dates</h4>',
'<div class="date-summary-container">', '<div class="date-summary-container">',
'<div class="date-summary date-summary-todays-date">', '<div class="date-summary date-summary-todays-date">',
'<h3 class="heading localized-datetime"', '<h3 class="heading localized-datetime"',
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<div>
<div class="recent-updates"> <div class="recent-updates">
% for index, update in enumerate(visible_updates): % for index, update in enumerate(visible_updates):
<article class="updates-article"> <article class="updates-article">
% if not update.get("is_error"): % if not update.get("is_error"):
<div class="date" id="msg-date-${index}">${update.get("date")}</div> <h5 class="date" id="msg-date-${index}">${update.get("date")}</h5>
<button <button
class="toggle-visibility-button" class="toggle-visibility-button"
data-hide="${_('Hide')}" data-hide="${_('Hide')}"
...@@ -34,7 +33,7 @@ ...@@ -34,7 +33,7 @@
<div class="old-updates hidden toggle-visibility-element" id="old-updates"> <div class="old-updates hidden toggle-visibility-element" id="old-updates">
% for index, update in enumerate(hidden_updates): % for index, update in enumerate(hidden_updates):
<article class="updates-article"> <article class="updates-article">
<div class="date" id="msg-date-${index + len(visible_updates)}">${update.get("date")}</div> <h5 class="date" id="msg-date-${index + len(visible_updates)}">${update.get("date")}</h5>
<button <button
class="toggle-visibility-button" class="toggle-visibility-button"
data-hide="${_('Hide')}" data-hide="${_('Hide')}"
...@@ -47,4 +46,3 @@ ...@@ -47,4 +46,3 @@
</article> </article>
% endfor % endfor
</div> </div>
<div>
...@@ -91,10 +91,11 @@ from openedx.core.djangolib.markup import HTML, Text ...@@ -91,10 +91,11 @@ from openedx.core.djangolib.markup import HTML, Text
</div> </div>
% endif % endif
</section> </section>
<section aria-label="${_('Handout Navigation')}" class="handouts"> <section aria-label="${_('Handout Navigation')}" class="handouts">
% if SelfPacedConfiguration.current().enable_course_home_improvements: % if SelfPacedConfiguration.current().enable_course_home_improvements:
<h4 class="handouts-header">${_("Important Course Dates")}</h1> <h4 class="handouts-header">${_("Important Course Dates")}</h4>
## Should be organized by date, last date appearing at the bottom ## Should be organized by date, last date appearing at the bottom
% for course_date in get_course_date_blocks(course, user): % for course_date in get_course_date_blocks(course, user):
...@@ -122,20 +123,19 @@ from openedx.core.djangolib.markup import HTML, Text ...@@ -122,20 +123,19 @@ from openedx.core.djangolib.markup import HTML, Text
</div> </div>
% endfor % endfor
% endif % endif
<h1 class="handouts-header">${_(course.info_sidebar_name)}</h1> <h4 class="handouts-header">${_(course.info_sidebar_name)}</h4>
${HTML(get_course_info_section(request, masquerade_user, course, 'handouts'))} ${HTML(get_course_info_section(request, masquerade_user, course, 'handouts'))}
</section> </section>
% else: % else:
<section class="updates"> <section class="updates">
<h1 class="handouts-header">${_("Course Updates and News")}</h1> <h4 class="handouts-header">${_("Course Updates and News")}</h4>
${HTML(get_course_info_section(request, masquerade_user, course, 'guest_updates'))} ${HTML(get_course_info_section(request, masquerade_user, course, 'guest_updates'))}
</section> </section>
<section aria-label="${_('Handout Navigation')}" class="handouts"> <section aria-label="${_('Handout Navigation')}" class="handouts">
<h1 class="handouts-header">${_("Course Handouts")}</h1> <h4 class="handouts-header">${_("Course Handouts")}</h4>
${HTML(get_course_info_section(request, masquerade_user, course, 'guest_handouts'))} ${HTML(get_course_info_section(request, masquerade_user, course, 'guest_handouts'))}
</section> </section>
% endif <!-- if course authenticated -->
% endif
</div> </div>
</div> </div>
</main> </main>
......
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