'Scenario: Remove profile image works correctly.
Given that I am on my profile page with public access
And I can see default image
When I move my cursor to the image
Then i can see the upload/remove image text
When i click on the remove image link
Then i can see the default image
And i can still see the default image after page reload.'

def test_user_can_remove_profile_image(self):

    (username, user_id) = self.log_in_as_unique_user()
    profile_page = self.visit_profile_page(username, privacy=self.PRIVACY_PUBLIC)
    self.assert_default_image_has_public_access(profile_page)
    with self.verify_pref_change_event_during(username, user_id, 'profile_image_uploaded_at', table='auth_userprofile'):
        profile_page.upload_file(filename='image.jpg')
    self.assertTrue(profile_page.image_upload_success)
    with self.verify_pref_change_event_during(username, user_id, 'profile_image_uploaded_at', table='auth_userprofile'):
        self.assertTrue(profile_page.remove_profile_image())
    self.assertTrue(profile_page.profile_has_default_image)
    profile_page.visit()
    self.assertTrue(profile_page.profile_has_default_image)
