def users(): user_leader_uid = users_svc.create(None, NewUser(**leader)) user_same_team_uid = users_svc.create(None, NewUser(**same_team)) user_other_team_uid = users_svc.create(None, NewUser(**other_team)) users = {} users['leader'] = users_svc.retrieve_one(None, user_leader_uid) users['same_team'] = users_svc.retrieve_one(None, user_same_team_uid) users['other_team'] = users_svc.retrieve_one(None, user_other_team_uid) return users
def users(): user_leader_uid = users_svc.create(None, NewUser(**leader))["uid"] user_same_team_uid = users_svc.create(None, NewUser(**same_team))["uid"] user_other_team_uid = users_svc.create(None, NewUser(**other_team))["uid"] users = {} users["leader"] = users_svc.retrieve_one(None, user_leader_uid) users["same_team"] = users_svc.retrieve_one(None, user_same_team_uid) users["other_team"] = users_svc.retrieve_one(None, user_other_team_uid) return users
def create(): db = MongoClient() users_svc = UsersService(db, 'users') teams_svc = TeamsService(db, 'teams') user_dict = { "given_name": "User", "family_name": "McLastName", "authenticators": [ { "issuer": "https://accounts.google.com", "subject": "x", "email": "*****@*****.**" } ] } user = NewUser(**user_dict) print(user) new_user_uid = users_svc.create("foo", user) new_team = { "name": "testr", "members": { new_user_uid: [ "member" ] } } teams_svc.create("foo", NewTeam(**new_team))
def test_user1(): return NewUser(given_name="ford", family_name="prefect", email="*****@*****.**")