Beispiel #1
0
 def get(self):
     if request.args.get('email_or_username'):
         ms_users = [
             MinespaceUser.find_by_email(
                 request.args.get('email_or_username'))
         ]
     else:
         ms_users = MinespaceUser.get_all()
     return ms_users
Beispiel #2
0
def test_post_minespace_user_new_email(test_client, auth_headers, setup_info):
    data = {
        "email": "*****@*****.**",
        "mine_guids": ["7dc50e1c-18cf-4272-9d5c-eb144959e109"]
    }

    post_resp = test_client.post('/users/minespace',
                                 json=data,
                                 headers=auth_headers['full_auth_header'])
    assert post_resp.status_code == 200, post_resp.response

    new_mu = MinespaceUser.find_by_email(data["email"])
    db.session.delete(new_mu)
    db.session.commit()

    assert json.loads(post_resp.data.decode())["email"] == data["email"]
Beispiel #3
0
def test_minespace_user_model_find_by_email(db_session):
    email = MinespaceUserFactory().email

    mu = MinespaceUser.find_by_email(email)
    assert mu.email == email
Beispiel #4
0
def test_minespace_user_model_find_by_email(db_session):
    email_or_username = MinespaceUserFactory().email_or_username

    mu = MinespaceUser.find_by_email(email_or_username)
    assert mu.email_or_username == email_or_username