-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: replace username with extrainfo national_id #222
Conversation
@@ -114,6 +114,7 @@ def tearDown(self): # pylint: disable=invalid-name | |||
self.transformer_class.get_data.reset_mock() | |||
self.transformer_class.get_data.side_effect = None | |||
self.transformer_class.get_object_iri.reset_mock() | |||
modulestore.reset_mock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is affecting other tests since assertion depends on clean mocks
f4bbe6a
to
f2f58bc
Compare
f2f58bc
to
6d169c5
Compare
@@ -14,7 +14,7 @@ | |||
from ddt import data, ddt | |||
from django.conf import settings | |||
from django.contrib.auth import get_user_model | |||
from django.test import override_settings | |||
from django.test import TestCase, override_settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you need to use Django test case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Becasue unittest.TestCase doesn't work with reverse relations, so things like user.extrainfo fails
eox_nelp/signals/receivers.py
Outdated
@@ -355,9 +355,12 @@ def mt_course_passed_handler(user, course_id, **kwargs): # pylint: disable=unus | |||
if not getattr(settings, "ACTIVATE_MT_TRAINING_STAGE", False): | |||
return | |||
|
|||
extra_info = getattr(user, "extrainfo", None) | |||
national_id = extra_info.national_id if extra_info else user.username |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about if national_id is "". that would be sent?. Is weird to found same usernames. But this this field of extra_info seems allow blank
Description
This replaces the username references with the extrainfo national id field
Testing instructions
Before
After
Additional information
Include anything else that will help reviewers and consumers understand the change.
Checklist for Merge