# Path: models/groups.py
# class Groups(bases.BaseModel):
# 
# Path: models/memberships.py
# class Memberships(bases.BaseModel):
# 
# Path: models/profiles.py
# class Profiles(bases.BaseModel):
#     def get_by_email(cls, email):
#     def validate_email(self, key, address):  # pylint: disable=unused-argument,no-self-use


    from builtins import *  # pylint: disable=unused-wildcard-import,redefined-builtin,wildcard-import
from sqlalchemy.exc import IntegrityError
from models import groups, memberships, profiles
    import sys
import warnings
import pytest

def test_required_profile_missing(dbsession):
    """
    Membership Profile not existing is an error.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    """
    group = groups.Groups(name='61f7d724-d90c-4e2f-85f4-7cab51d68b61')
    membership = memberships.Memberships(group=group)
    membership.save()

    with pytest.raises(IntegrityError):
        dbsession.commit()

def test_required_group_missing(dbsession):
    """
    Membership Group not existing is an error.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    """
    profile = profiles.Profiles(full_name='103ae318 69f4f2471acc', email='73c5@4568.8dd9')
    membership = memberships.Memberships(profile=profile)
    membership.save()

    with pytest.raises(IntegrityError):
        dbsession.commit()

def test_required_fields(dbsession):
    """
    Membership Profile and Group are required fields.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    """

# Path: models/groups.py
# class Groups(bases.BaseModel):
# 
# Path: models/memberships.py
# class Memberships(bases.BaseModel):
# 
# Path: models/profiles.py
# class Profiles(bases.BaseModel):
#     def get_by_email(cls, email):
#     def validate_email(self, key, address):  # pylint: disable=unused-argument,no-self-use


# Path: tests/models/test_memberships.py
    from builtins import *  # pylint: disable=unused-wildcard-import,redefined-builtin,wildcard-import
from sqlalchemy.exc import IntegrityError
from models import groups, memberships, profiles
    import sys
import warnings
import pytest


def test_required_profile_missing(dbsession):
    """
    Membership Profile not existing is an error.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    """
    group = groups.Groups(name='61f7d724-d90c-4e2f-85f4-7cab51d68b61')
    membership = memberships.Memberships(group=group)
    membership.save()

    with pytest.raises(IntegrityError):
        dbsession.commit()

def test_required_group_missing(dbsession):
    """
    Membership Group not existing is an error.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    """
    profile = profiles.Profiles(full_name='103ae318 69f4f2471acc', email='73c5@4568.8dd9')
    membership = memberships.Memberships(profile=profile)
    membership.save()

    with pytest.raises(IntegrityError):
        dbsession.commit()

def test_required_fields(dbsession):
    """
    Membership Profile and Group are required fields.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    """

    group = groups.Groups(name='82cc113d-fee2-4b85-b28e-2bf312bec470')