'Visit a user\'s profile page and if a privacy is specified and
is different from the displayed value, then set the privacy to that value.'

def visit_profile_page(self, username, privacy=None):

    profile_page = LearnerProfilePage(self.browser, username)
    if (privacy is not None):
        profile_page.visit()
        profile_page.privacy = privacy
        if (privacy == self.PRIVACY_PUBLIC):
            self.assertEqual(profile_page.privacy, 'all_users')
        else:
            self.assertEqual(profile_page.privacy, 'private')
        if (privacy == self.PRIVACY_PUBLIC):
            self.set_public_profile_fields_data(profile_page)
    self.start_time = datetime.now()
    profile_page.visit()
    return profile_page
