# Path: app/modules/teams/models.py
# class TeamMember(db.Model):
# class Team(db.Model, Timestamp):
#     def __repr__(self):
#     def check_owner(self, user):
#     def check_supervisor(self, user):
#     def __repr__(self):
#     def validate_title(self, key, title):  # pylint: disable=unused-argument,no-self-use
#     def check_owner(self, user):


import json
from app.modules.teams import models

    assert response.status_code == 200
    assert response.content_type == 'application/json'
    assert set(response.json.keys()) >= {'id', 'title'}
    assert response.json['title'] == team_title

    # Cleanup
    team = models.Team.query.get(response.json['id'])
    assert team.title == team_title
    with db.session.begin():
        db.session.delete(team)

def test_new_team_first_member_is_creator(flask_app_client, db, regular_user):
    # pylint: disable=invalid-name
    team_title = "Test Team Title"
    with flask_app_client.login(
            regular_user,
            auth_scopes=('teams:write', 'teams:read')
        ):
        response = flask_app_client.post('/api/v1/teams/', data={'title': team_title})

    assert response.status_code == 200
    assert response.content_type == 'application/json'
    assert set(response.json.keys()) >= {'id', 'title'}
    assert response.json['title'] == team_title
    assert len(response.json['members']) == 1
    assert response.json['members'][0]['user']['id'] == regular_user.id
    assert response.json['members'][0]['is_leader'] == True

    # Cleanup

# Path: app/modules/teams/models.py
# class TeamMember(db.Model):
# class Team(db.Model, Timestamp):
#     def __repr__(self):
#     def check_owner(self, user):
#     def check_supervisor(self, user):
#     def __repr__(self):
#     def validate_title(self, key, title):  # pylint: disable=unused-argument,no-self-use
#     def check_owner(self, user):


# Path: tests/modules/teams/resources/test_modifying_teams.py
import json
from app.modules.teams import models


    assert response.status_code == 200
    assert response.content_type == 'application/json'
    assert set(response.json.keys()) >= {'id', 'title'}
    assert response.json['title'] == team_title

    # Cleanup
    team = models.Team.query.get(response.json['id'])
    assert team.title == team_title
    with db.session.begin():
        db.session.delete(team)

def test_new_team_first_member_is_creator(flask_app_client, db, regular_user):
    # pylint: disable=invalid-name
    team_title = "Test Team Title"
    with flask_app_client.login(
            regular_user,
            auth_scopes=('teams:write', 'teams:read')
        ):
        response = flask_app_client.post('/api/v1/teams/', data={'title': team_title})

    assert response.status_code == 200
    assert response.content_type == 'application/json'
    assert set(response.json.keys()) >= {'id', 'title'}
    assert response.json['title'] == team_title
    assert len(response.json['members']) == 1
    assert response.json['members'][0]['user']['id'] == regular_user.id
    assert response.json['members'][0]['is_leader'] == True

    # Cleanup

    team = models.Team.query.get(response.json['id'])