Livia-1212 / event_manager

MIT License
0 stars 0 forks source link

Email Service Issues #4

Open Livia-1212 opened 12 hours ago

Livia-1212 commented 12 hours ago

Tests related to the email service fail due to SMTP server connection issues, resulting in smtplib.SMTPServerDisconnected: Connection unexpectedly closed.

Affected Tests: test_send_markdown_email test_create_user_with_valid_data test_register_user_with_valid_data

Suggested Fix:

Verify SMTP configuration in the .env or settings file (e.g., smtp_server, smtp_username, smtp_password). Ensure the SMTP server is accessible and properly configured for testing purposes. For tests, consider mocking the SMTP client to avoid actual server dependency.

Livia-1212 commented 11 hours ago

updated email_service.py

Livia-1212 commented 4 hours ago

Steps Performed: Used the nc (Netcat) command to test the connectivity to the SMTP server (smtp.mailtrap.io) on port 2525: nc -vz smtp.mailtrap.io 2525

Result: Connection to smtp.mailtrap.io port 2525 [tcp/ms-v-worlds] succeeded!

This indicates that: The server is reachable from the current environment. Port 2525 is open and accepting connections.

Next Steps:

  1. Verify SMTP Configuration in the Application
  2. Test Email Sending Locally
  3. Check Error Logs
  4. Mock the Email Service in Tests
  5. Enable Debug Logging (Optional)
Livia-1212 commented 53 minutes ago

The issue was marked as completed in #6 accidentally.

Current remaining issues: tests/test_email.py::test_send_markdown_email - smtplib.SMTPServerDisconnected: Connection unexpectedly closed