provide DummyMailDelivery for testing; fix auth
This commit is contained in:
parent
efd47419a0
commit
f04297d570
2 changed files with 19 additions and 0 deletions
16
scopes/organize/mail.py
Normal file
16
scopes/organize/mail.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# scopes.organize.mail
|
||||||
|
|
||||||
|
from zope.interface import implementer
|
||||||
|
from zope.sendmail.interfaces import IMailDelivery
|
||||||
|
|
||||||
|
"""Utilities for creating and sending emails."""
|
||||||
|
|
||||||
|
|
||||||
|
@implementer(IMailDelivery)
|
||||||
|
class DummyMailDelivery:
|
||||||
|
"""For testing purposes: just store mails in maildata.log"""
|
||||||
|
|
||||||
|
def send(self, fromaddr, toaddrs, message):
|
||||||
|
print("DummyMailDelivery")
|
||||||
|
print(f"fromaddr: {fromaddr}, toaddrs: {toaddrs}")
|
||||||
|
print(message)
|
|
@ -34,3 +34,6 @@ class JwtAuthentication:
|
||||||
if self.baseAuth is not None:
|
if self.baseAuth is not None:
|
||||||
return self.baseAuth.unauthorized(id, request)
|
return self.baseAuth.unauthorized(id, request)
|
||||||
|
|
||||||
|
def logout(self, request):
|
||||||
|
print('*** JwtAuthentication: logout')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue