def test_create_fails_if_pending_account_has_same_email():
"""
Test checks to see if an email is tied to a pending account creation entry
in logincreate. If so, login.create() will not permit another account to be
made for the same address.
"""
d.engine.execute(d.meta.tables["logincreate"].insert(), {
"token": 40 * "a",
"username": "existing",
"login_name": "existing",
"hashpass": login.passhash(raw_password),
"email": email_addr,
"birthday": arrow.Arrow(2000, 1, 1),
"unixtime": arrow.now(),
})
form = Bag(username="test", password='0123456789', passcheck='0123456789',
email=email_addr, emailcheck=email_addr,
day='12', month='12', year=arrow.now().year - 19)
with pytest.raises(WeasylError) as err:
login.create(form)
assert 'emailExists' == err.value.value
评论列表
文章目录