Skip to content
Snippets Groups Projects
Commit 4af929fb authored by Jillian Vogel's avatar Jillian Vogel
Browse files

Fixes test failures

parent 761acdfc
Branches
Tags release-2019-06-19-11.15
No related merge requests found
......@@ -121,32 +121,29 @@ class TestActivateAccount(TestCase):
"""
# Log in with test user.
self.login()
expected_message = render_to_string(
'registration/account_activation_sidebar_notice.html',
{
'email': self.user.email,
'platform_name': self.platform_name,
'activation_email_support_link': self.activation_email_support_link
}
expected_message = (
u"Check your {email_start}{email}{email_end} inbox for an account activation link from "
u"{platform_name}. If you need help, contact {link_start}{platform_name} Support{link_end}."
).format(
platform_name=self.platform_name,
email_start="<strong>",
email_end="</strong>",
email=self.user.email,
link_start="<a target='_blank' href='{activation_email_support_link}'>".format(
activation_email_support_link=self.activation_email_support_link,
),
link_end="</a>",
)
response = self.client.get(reverse('dashboard'))
self.assertContains(response, expected_message, html=True)
self.assertContains(response, expected_message)
# Now make sure account activation message goes away when user activated the account
self.user.is_active = True
self.user.save()
self.login()
expected_message = render_to_string(
'registration/account_activation_sidebar_notice.html',
{
'email': self.user.email,
'platform_name': self.platform_name,
'activation_email_support_link': self.activation_email_support_link
}
)
response = self.client.get(reverse('dashboard'))
self.assertNotContains(response, expected_message, html=True)
self.assertNotContains(response, expected_message)
def test_account_activation_notification_on_logistration(self):
"""
......
......@@ -611,17 +611,17 @@ def student_dashboard(request):
activate_account_message = ''
if not user.is_active:
activate_account_message = Text(_(
"Check your {email_start}{email}{email_end} inbox for an account activation link from {platform_name}. "
"If you need help, contact {link_start}{platform_name} Support{link_end}."
"Check your {email_start}{email}{email_end} inbox for an account activation link from {platform_name}. "
"If you need help, contact {link_start}{platform_name} Support{link_end}."
)).format(
platform_name=platform_name,
email_start=HTML("<strong>"),
email_end=HTML("</strong>"),
email=user.email,
link_start=HTML("<a target='_blank' href='{activation_email_support_link}'>").format(
activation_email_support_link=activation_email_support_link,
),
link_end=HTML("</a>"),
platform_name=platform_name,
email_start=HTML("<strong>"),
email_end=HTML("</strong>"),
email=user.email,
link_start=HTML("<a target='_blank' href='{activation_email_support_link}'>").format(
activation_email_support_link=activation_email_support_link,
),
link_end=HTML("</a>"),
)
enterprise_message = get_dashboard_consent_notification(request, user, course_enrollments)
......@@ -819,7 +819,7 @@ def student_dashboard(request):
'disable_courseware_js': True,
'display_course_modes_on_dashboard': enable_verified_certificates and display_course_modes_on_dashboard,
'display_sidebar_on_dashboard': display_sidebar_on_dashboard,
'display_sidebar_account_activation_message': (not user.is_active and not hide_dashboard_courses_until_activated),
'display_sidebar_account_activation_message': not(user.is_active or hide_dashboard_courses_until_activated),
'display_dashboard_courses': (user.is_active or not hide_dashboard_courses_until_activated),
'empty_dashboard_message': empty_dashboard_message,
}
......
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