def test_pre_delete_user_for_full_user_also_deletes_all_profiles(self):
    user_settings = user_services.get_user_settings(self.user_1_id)
    self.assertFalse(user_settings.deleted)
    profile_user_settings = user_services.get_user_settings(self.profile_user_id)
    self.assertFalse(profile_user_settings.deleted)
    profile_auth_details = user_services.get_user_settings(self.profile_user_id)
    self.assertFalse(profile_auth_details.deleted)
    wipeout_service.pre_delete_user(self.user_1_id)
    self.process_and_flush_pending_tasks()
    user_settings = user_models.UserSettingsModel.get_by_id(self.user_1_id)
    self.assertTrue(user_settings.deleted)
    user_auth_details = auth_models.UserAuthDetailsModel.get_by_id(self.profile_user_id)
    self.assertTrue(user_auth_details.deleted)
    profile_user_settings = user_models.UserSettingsModel.get_by_id(self.profile_user_id)
    self.assertTrue(profile_user_settings.deleted)
    profile_auth_details = auth_models.UserAuthDetailsModel.get_by_id(self.profile_user_id)
    self.assertTrue(profile_auth_details.deleted)
def test_pre_delete_user_for_full_user_also_deletes_all_profiles(self):
    user_settings = user_services.get_user_settings(self.user_1_id)
    self.assertFalse(user_settings.deleted)
    profile_user_settings = user_services.get_user_settings(self.profile_user_id)
    self.assertFalse(profile_user_settings.deleted)
    profile_auth_details = user_services.get_user_settings(self.profile_user_id)
    self.assertFalse(profile_auth_details.deleted)
    wipeout_service.pre_delete_user(self.user_1_id)
    self.process_and_flush_pending_tasks()
    user_settings = user_models.UserSettingsModel.get_by_id(self.user_1_id)
    self.assertTrue(user_settings.deleted)
    user_auth_details = auth_models.UserAuthDetailsModel.get_by_id(self.profile_user_id)
    self.assertTrue(user_auth_details.deleted)
    profile_user_settings = user_models.UserSettingsModel.get_by_id(self.profile_user_id)
    self.assertTrue(profile_user_settings.deleted)
    profile_auth_details = auth_models.UserAuthDetailsModel.get_by_id(self.profile_user_id)
    self.assertTrue(profile_auth_details.deleted)