test_deprecated.py 588 B

12345678910111213141516171819
  1. import pytest
  2. from redmail import EmailSender
  3. def test_user_name():
  4. "user_name has been deprecated. Testing backward compatibility."
  5. with pytest.warns(FutureWarning):
  6. email = EmailSender(host="localhost", port=0, user_name="testing", password="1234")
  7. assert email.username == "testing"
  8. with pytest.warns(FutureWarning):
  9. assert email.user_name == "testing"
  10. with pytest.warns(FutureWarning):
  11. email.user_name = "another"
  12. assert email.username == "another"
  13. with pytest.warns(FutureWarning):
  14. assert email.user_name == "another"