forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dkaplan1/APER-1322_certs-with-invalidation…
…-records-arent-in-the-unavailable-status
- Loading branch information
Showing
25 changed files
with
1,191 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
from common.djangoapps.student.signals.signals import USER_EMAIL_CHANGED | ||
from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory, UserProfileFactory | ||
from lms.djangoapps.courseware.toggles import COURSEWARE_MICROFRONTEND_PROGRESS_MILESTONES | ||
from openedx.core.djangolib.testing.utils import skip_unless_lms | ||
from openedx.core.djangolib.testing.utils import skip_unless_lms, get_mock_request | ||
from openedx.features.name_affirmation_api.utils import is_name_affirmation_installed | ||
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order | ||
|
||
|
@@ -75,10 +75,18 @@ def test_listen_for_verified_name_approved(self): | |
@patch('common.djangoapps.student.signals.receivers.get_braze_client') | ||
def test_listen_for_user_email_changed(self, mock_get_braze_client): | ||
""" | ||
Ensure that USER_EMAIL_CHANGED signal triggers correct calls to get_braze_client. | ||
Ensure that USER_EMAIL_CHANGED signal triggers correct calls to | ||
get_braze_client and update email in session. | ||
""" | ||
user = UserFactory(email='[email protected]', username='jdoe') | ||
request = get_mock_request(user=user) | ||
request.session = self.client.session | ||
|
||
USER_EMAIL_CHANGED.send(sender=None, user=user) | ||
# simulating email change | ||
user.email = '[email protected]' | ||
user.save() | ||
|
||
USER_EMAIL_CHANGED.send(sender=None, user=user, request=request) | ||
|
||
assert mock_get_braze_client.called | ||
assert request.session.get('email', None) == user.email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.