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

MockMailHostLayer is outdated #61

Closed
ale-rt opened this issue Dec 12, 2019 · 1 comment · Fixed by #64
Closed

MockMailHostLayer is outdated #61

ale-rt opened this issue Dec 12, 2019 · 1 comment · Fixed by #64

Comments

@ale-rt
Copy link
Member

ale-rt commented Dec 12, 2019

In this lines

portal.email_from_address = 'noreply@example.com'
portal.email_from_name = 'Plone Site'
portal._original_MailHost = portal.MailHost
portal.MailHost = mailhost = MockMailHost('MailHost')
portal.MailHost.smtp_host = 'localhost'

a site setup that is no longer operational since quite a lot of time is used.
Nowadays we should use the registry.

@ale-rt
Copy link
Member Author

ale-rt commented Dec 12, 2019

Note: see a possible fix in

registry = getUtility(IRegistry, context=portal)
registry["plone.email_from_address"] = "noreply@example.com"
registry["plone.email_from_name"] = u"Plone site"
portal._original_MailHost = portal.MailHost
portal.MailHost = mailhost = MockMailHost('MailHost')
portal.MailHost.smtp_host = 'localhost'
, although the smtp_host is still configured in the old way.

ale-rt added a commit that referenced this issue Feb 4, 2020
Fix a test isolation issue that was preventing the MOCK_MAILHOST_FIXTURE
to be used in multiple testcases (Fixes #61),

Properly configure the mail sender setting the appropriate registry
records (Fixes #62),

Adds test coverage.
ale-rt added a commit that referenced this issue Feb 5, 2020
Fix a test isolation issue that was preventing the MOCK_MAILHOST_FIXTURE
to be used in multiple testcases (Fixes #61),

Properly configure the mail sender setting the appropriate registry
records (Fixes #62),

Adds test coverage.
ale-rt added a commit that referenced this issue Feb 5, 2020
Fix a test isolation issue that was preventing the MOCK_MAILHOST_FIXTURE
to be used in multiple testcases (Fixes #61),

Properly configure the mail sender setting the appropriate registry
records (Fixes #62),

Adds test coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant