Commit 51976b06 by David Baumgold

Minor improvements to learner profile tests

parent 77d7a38b
......@@ -159,10 +159,16 @@ class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest):
"""
Verify age limit messages for a user.
"""
self.set_birth_year(birth_year=birth_year if birth_year is not None else "")
if birth_year:
self.set_birth_year(birth_year=birth_year)
else:
self.set_birth_year(birth_year="")
profile_page = self.visit_profile_page(username)
self.assertTrue(profile_page.privacy_field_visible)
self.assertEqual(profile_page.age_limit_message_present, message is not None)
if message:
self.assertTrue(profile_page.age_limit_message_present)
else:
self.assertFalse(profile_page.age_limit_message_present)
self.assertIn(message, profile_page.profile_forced_private_message)
def test_profile_defaults_to_public(self):
......@@ -245,7 +251,7 @@ class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest):
dashboard_page = DashboardPage(self.browser)
dashboard_page.visit()
dashboard_page.click_username_dropdown()
self.assertTrue('Profile' in dashboard_page.username_dropdown_link_text)
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()
......
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