Skip to content
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: profile api save extrainfo arabic fields #194

Merged
merged 8 commits into from
Jul 12, 2024

Conversation

johanseto
Copy link
Collaborator

@johanseto johanseto commented Jul 10, 2024

Description

Add extrainfo change capability with user profile data.

Testing instructions

Use post to {lms_domain}/eox-nelp/api/user-profile/v1/update-user-data/ and update extrainfo data

After

Screencast.from.10-07-24.17.13.25.webm

Additional information

Include anything else that will help reviewers and consumers understand the change.

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, security, or accessibility.
  • Link to other information about the change, such as Jira issues, GitHub issues, or Discourse discussions.

Checklist for Merge

  • Tested in a remote environment
  • Updated documentation
  • Rebased master/main
  • Squashed commits

@johanseto johanseto self-assigned this Jul 10, 2024
@johanseto johanseto changed the title feat: profile api save extranfo arabic fields feat: profile api save extrainfo arabic fields Jul 10, 2024
fix C901 'update_user_data' is too complex (11)
@johanseto johanseto marked this pull request as ready for review July 10, 2024 22:15
eox_nelp/tests/test_utils.py Outdated Show resolved Hide resolved
eox_nelp/user_profile/api/v1/views.py Outdated Show resolved Hide resolved
eox_nelp/user_profile/api/v1/views.py Outdated Show resolved Hide resolved
eox_nelp/user_profile/api/v1/views.py Outdated Show resolved Hide resolved
eox_nelp/user_profile/api/v1/views.py Outdated Show resolved Hide resolved
eox_nelp/user_profile/api/v1/views.py Outdated Show resolved Hide resolved
@override_settings(
ENABLE_OTP_VALIDATION=False,
REQUIRED_USER_EXTRA_INFO_FIELDS=["arabic_first_name", "arabic_last_name"],
PEARSON_RTI_ACTIVATE_GRADED_GATE=True,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we could remove this since the test purpose is to check if the extrainfo records was updated instead of checking if the CCD was called

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The profile API does the same, but I think that the cdd_task could also be verified.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEARSON_RTI_ACTIVATE_GRADED_GATE=True,
)
@patch("eox_nelp.user_profile.api.v1.views.cdd_task")
def test_update_extra_info_fields(self, cdd_task_mock):
"""
Test that extra account user fields has been set.
Expected behavior:
- Check the response says that the field has been updated.
- Status code 200.
- Check that update_account_settings method has called once.
- Check that user first_name has been updated.
- Check that user last_name has been updated.
- Check cdd_task async task is called with user.id

eox_nelp/user_profile/api/v1/tests/test_views.py Outdated Show resolved Hide resolved
eox_nelp/utils.py Outdated Show resolved Hide resolved
eox_nelp/user_profile/api/v1/views.py Outdated Show resolved Hide resolved
eox_nelp/user_profile/api/v1/views.py Outdated Show resolved Hide resolved
eox_nelp/user_profile/api/v1/views.py Outdated Show resolved Hide resolved
@andrey-canon andrey-canon merged commit 0e1713d into master Jul 12, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants