Skip to content

Commit

Permalink
💚 📝 Don't send email from Circle
Browse files Browse the repository at this point in the history
The Circle environment is failing to send emails, so for now, dropping
that functionality from the tests.

:rewind: Revert ":green_heart: Remove email from test user"

This reverts commit ad6d66e.
  • Loading branch information
shnizzedy committed Dec 9, 2019
1 parent ad6d66e commit adc207b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
5 changes: 3 additions & 2 deletions girderformindlogger/models/applet.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ def createAppletFromUrl(
protocolUrl,
user=None,
roles=None,
constraints=None
constraints=None,
sendEmail=True
):
from girderformindlogger.models.protocol import Protocol
# get a protocol from a URL
Expand Down Expand Up @@ -186,7 +187,7 @@ def createAppletFromUrl(
str(applet.get('applet', applet).get('_id')
)
)
if 'email' in user:
if sendEmail and 'email' in user:
from girderformindlogger.utility.mail_utils import sendMail
sendMail(
subject=name,
Expand Down
27 changes: 14 additions & 13 deletions test/testLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ def testCreateUser(email=None, admin=False):
displayName = 'test'
# NOTE: girder makes login and email lowercase!!!
login = 'testuser{}'.format(randomUser)
# if not email:
# email = 'testemail{}@testemail.com'.format(randomUser)
if not email:
email = 'testemail{}@testemail.com'.format(randomUser)
password = 'password'
createUser = UserModel().createUser(
login=login,
password=password,
displayName=displayName,
# email=email
email=email
)
assert createUser['email'] == email, 'email does not match, {} {}'.format(
createUser['email'],
email
)
# assert createUser['email'] == email, 'email does not match, {} {}'.format(
# createUser['email'],
# email
# )
assert createUser['displayName'] == displayName, 'displayName does not match'
assert createUser['login'] == login, 'login does not match, {} {}'.format(
createUser['login'],
Expand Down Expand Up @@ -167,7 +167,8 @@ def addApplet(new_user, protocolUrl):
ar = AppletModel().createAppletFromUrl(
name="testProtocol{}".format(randomAS),
protocolUrl=protocolUrl,
user=currentUser
user=currentUser,
sendEmail=False
)

while len(userApplets)==len(userAppletsToStart):
Expand Down Expand Up @@ -872,11 +873,11 @@ def step01():
# First user will be admin on a new image
admin = testCreateUser(admin=True)
user = testCreateUser()
# with pytest.raises(AccessException) as excinfo:
# authenticateWithEmailAddress(
# user.get('email', 'test@mindlogger.org')
# )
# assert "your username rather than your email" in str(excinfo.value)
with pytest.raises(AccessException) as excinfo:
authenticateWithEmailAddress(
user.get('email', 'test@mindlogger.org')
)
assert "your username rather than your email" in str(excinfo.value)
currentUser = authenticate(user)
return user

Expand Down

0 comments on commit adc207b

Please sign in to comment.