'Scenario: Verify that the user can change their privacy.
Given that I am a registered user
And I visit my public profile page
And I set the profile visibility to private
Then a user preference changed event should be recorded
When I reload the page
Then the profile visibility should be shown as private'

def test_make_profile_private(self):

    (username, user_id) = self.log_in_as_unique_user()
    profile_page = self.visit_profile_page(username, privacy=self.PRIVACY_PUBLIC)
    with self.verify_pref_change_event_during(username, user_id, 'account_privacy', old=None, new=self.PRIVACY_PRIVATE):
        profile_page.privacy = self.PRIVACY_PRIVATE
    self.browser.refresh()
    profile_page.wait_for_page()
    self.verify_profile_page_is_private(profile_page)
