Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
f0379517
Commit
f0379517
authored
6 years ago
by
John Eskew
Browse files
Options
Downloads
Patches
Plain Diff
Use updated name of test helper method to fix unit tests.
parent
086affe1
No related branches found
Branches containing commit
Tags
release-2021-06-07-11.14
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/user_api/management/tests/test_bulk_rehash_retired_usernames.py
+6
-4
6 additions, 4 deletions
...pi/management/tests/test_bulk_rehash_retired_usernames.py
with
6 additions
and
4 deletions
openedx/core/djangoapps/user_api/management/tests/test_bulk_rehash_retired_usernames.py
+
6
−
4
View file @
f0379517
...
...
@@ -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
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment