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

added check for email provider check before sending reset password email #2544

Conversation

DraKen0009
Copy link
Contributor

Proposed Changes

  • Added a check to check if the email have valid configrations

Associated Issue

image

Merge Checklist

  • Tests added/fixed
  • Linting Complete

Only PR's with test cases included and passing lint and test pipelines will be reviewed

@ohcnetwork/care-backend-maintainers @ohcnetwork/care-backend-admins

@DraKen0009 DraKen0009 requested a review from a team as a code owner October 16, 2024 12:07

@override_settings(
IS_PRODUCTION=True,
EMAIL_HOST="smtp.gmail.com",
Copy link
Member

Choose a reason for hiding this comment

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

use a dummy host not something that could actually work.

EMAIL_HOST_PASSWORD="your-app-password",
)
def test_forgot_password_with_email_configration(self):
response = self.client.post(
Copy link
Member

Choose a reason for hiding this comment

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

We should mock the bits that actually send the email and confirm that the email has been sent.

@DraKen0009
Copy link
Contributor Author

@vigneshhari made the updates , Please take a look

Copy link

codecov bot commented Oct 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.00%. Comparing base (00cd5f9) to head (b9debdb).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2544   +/-   ##
========================================
  Coverage    70.00%   70.00%           
========================================
  Files          198      198           
  Lines        11660    11662    +2     
  Branches      1604     1605    +1     
========================================
+ Hits          8162     8164    +2     
  Misses        3107     3107           
  Partials       391      391           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vigneshhari
Copy link
Member

Tests that check if the email was sent were still not added.

@vigneshhari vigneshhari merged commit 8bac44a into ohcnetwork:develop Oct 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Respond with an appropriate error message when the email provider is not configured
3 participants