def test_pre_delete_username_is_saved_for_user_older_than_week(self):
    date_10_days_ago = (datetime.datetime.utcnow() - datetime.timedelta(days=10))
    with self.mock_datetime_utcnow(date_10_days_ago):
        self.signup(self.USER_3_EMAIL, self.USER_3_USERNAME)
    user_3_id = self.get_user_id_from_email(self.USER_3_EMAIL)
    wipeout_service.pre_delete_user(user_3_id)
    self.process_and_flush_pending_tasks()
    pending_deletion_request = wipeout_service.get_pending_deletion_request(user_3_id)
    self.assertEqual(pending_deletion_request.normalized_long_term_username, self.USER_3_USERNAME)
def test_pre_delete_username_is_saved_for_user_older_than_week(self):
    date_10_days_ago = (datetime.datetime.utcnow() - datetime.timedelta(days=10))
    with self.mock_datetime_utcnow(date_10_days_ago):
        self.signup(self.USER_3_EMAIL, self.USER_3_USERNAME)
    user_3_id = self.get_user_id_from_email(self.USER_3_EMAIL)
    wipeout_service.pre_delete_user(user_3_id)
    self.process_and_flush_pending_tasks()
    pending_deletion_request = wipeout_service.get_pending_deletion_request(user_3_id)
    self.assertEqual(pending_deletion_request.normalized_long_term_username, self.USER_3_USERNAME)