Closed Livia-1212 closed 2 hours ago
updated email_service.py
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:
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
New issue: there is no user_base_data_invalid fixture
Fix: Added fixture user_base_data_invalid that returns the "email": "john.doe.example.com" inside conftest.py. This will ensure that the test passes test_user_base_invalid_email in test_user_schemas.py
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:
1.Verify SMTP configuration in the .env or settings file (e.g., smtp_server, smtp_username, smtp_password). 2.Ensure the SMTP server is accessible and properly configured for testing purposes. For tests, consider mocking the SMTP client to avoid actual server dependency.