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

[FIX] mail_outbound_static unittest test_ir_mail_server.py #962

Merged

Conversation

mt-software-de
Copy link
Contributor

@mt-software-de mt-software-de commented Sep 12, 2022

Fixing unittest mail_outbound_static unittest test_ir_mail_server.py
For higher python versions

I am currently using, python 3.9 without my changes i will get this error message on executing the unittests for mail_outbount_static.

Traceback (most recent call last):
  File "/opt/addons/mail_outbound_static/tests/test_ir_mail_server.py", line 98, in test_send_email_injects_from_no_canonical
    message = self._send_mail()
  File "/opt/addons/mail_outbound_static/tests/test_ir_mail_server.py", line 92, in _send_mail
    send_from, send_to, message_string = connect().sendmail.call_args[0]
TypeError: 'NoneType' object is not subscriptable

Therefor i'm fixing the unittests for python version greater than equal 3.7.4

@mt-software-de
Copy link
Contributor Author

@simahawk or @pedrobaeza could you please have a look?

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 26, 2023
@mt-software-de
Copy link
Contributor Author

@rousseldenis or @jbaudoux could you maybe have a look?

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Apr 2, 2023
@github-actions
Copy link

github-actions bot commented Aug 6, 2023

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Aug 6, 2023
@mt-software-de
Copy link
Contributor Author

Could someone please review this or add the "no stale" label?
Maybe @simahawk ?

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Aug 13, 2023
@simahawk simahawk added the no stale Use this label to prevent the automated stale action from closing this PR/Issue. label Aug 23, 2023
@simahawk
Copy link
Contributor

simahawk commented Aug 23, 2023

@mt-software-de can you please amend the commit?
It should be

[fix] mail_outbound_statinc: fix test py compat

A better explanation here pls, possibly w/ the stack trace that you get.
Also, it would be nice to have the stack trace on the description
so that ppl having the same problem can find this fix easily ;)

@mt-software-de mt-software-de force-pushed the FIX-mail_outbound_static-unittest branch from 1d1bf15 to f485751 Compare August 23, 2023 11:29
@simahawk
Copy link
Contributor

I like "combat" 🤣

Executing the unittests with a python version >= 3.7.4
causing following error.

Traceback (most recent call last):
  File "/opt/addons/mail_outbound_static/tests/test_ir_mail_server.py", line 117, in test_send_email_injects_from_with_canonical
    message = self._send_mail(mail_server_id=mail_server_id)
  File "/opt/addons/mail_outbound_static/tests/test_ir_mail_server.py", line 92, in _send_mail
    send_from, send_to, message_string = connect().sendmail.call_args[0]
TypeError: 'NoneType' object is not subscriptable

Now it checks the python version
and changes the call for higher versions
@mt-software-de mt-software-de force-pushed the FIX-mail_outbound_static-unittest branch from f485751 to bc7850a Compare August 23, 2023 15:12
@simahawk
Copy link
Contributor

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 14.0-ocabot-merge-pr-962-by-simahawk-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 18a838b into OCA:14.0 Oct 18, 2023
4 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at b218067. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged 🎉 no stale Use this label to prevent the automated stale action from closing this PR/Issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants