Skip to content
Snippets Groups Projects
Commit f0379517 authored by John Eskew's avatar John Eskew
Browse files

Use updated name of test helper method to fix unit tests.

parent 086affe1
No related branches found
Tags release-2021-06-07-11.14
No related merge requests found
......@@ -8,7 +8,9 @@ from django.conf import settings
from django.core.management import call_command
from user_util.user_util import get_retired_username
from openedx.core.djangoapps.user_api.accounts.tests.retirement_helpers import RetirementTestCase, fake_retirement
from openedx.core.djangoapps.user_api.accounts.tests.retirement_helpers import (
setup_retirement_states, fake_completed_retirement
)
from openedx.core.djangoapps.user_api.models import UserRetirementStatus
from openedx.core.djangolib.testing.utils import skip_unless_lms
from student.tests.factories import UserFactory
......@@ -39,7 +41,7 @@ def _setup_users():
retirements[user.id] = retirement
if i in user_indexes_to_be_fake_retired:
fake_retirement(user)
fake_completed_retirement(user)
if i in user_indexes_to_be_rehashed:
# In order to need a rehash user.username must be the same as
......@@ -58,12 +60,12 @@ def _setup_users():
@skip_unless_lms
@pytest.mark.usefixtures("setup_retirement_states")
@patch('lms.lib.comment_client.User.retire')
def test_successful_rehash(retire_user_forums, capsys):
"""
Run the command with users of all different hash statuses, expect success
"""
RetirementTestCase.setup_states()
users_skipped, users_faked, users_needing_rehash, retirements = _setup_users()
call_command('bulk_rehash_retired_usernames')
......@@ -98,12 +100,12 @@ def test_successful_rehash(retire_user_forums, capsys):
@skip_unless_lms
@pytest.mark.usefixtures("setup_retirement_states")
@patch('lms.lib.comment_client.User.retire')
def test_forums_failed(retire_user_forums, capsys):
"""
Run the command with users of all different hash statuses, expect success
"""
RetirementTestCase.setup_states()
users_skipped, users_faked, users_needing_rehash, retirements = _setup_users()
retire_user_forums.side_effect = Exception('something bad happened with forums')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment