# 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



warnings.simplefilter("error")  # Make All warnings errors while testing.

def test_required_fields_blank(dbsession):
    """
    Groups must have a name.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    """
    group = groups.Groups()
    group.save()

    # name is blank
    with pytest.raises(IntegrityError):
        dbsession.commit()

def test_create_group(dbsession):
    """
    Create a Group
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    """
    group = groups.Groups(name='A New Group')
    group.save()
    dbsession.commit()

def test_memberships_relation(dbsession):
    """ Groups can have Memberships relations. """
    profile1 = profiles.Profiles(full_name='92e17a59 740480af51b5', email='6b7d@4c4b.b33d')
    membership1 = memberships.Memberships(profile=profile1)

# 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_groups.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




warnings.simplefilter("error")  # Make All warnings errors while testing.

def test_required_fields_blank(dbsession):
    """
    Groups must have a name.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    """
    group = groups.Groups()
    group.save()

    # name is blank
    with pytest.raises(IntegrityError):
        dbsession.commit()

def test_create_group(dbsession):
    """
    Create a Group
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    """
    group = groups.Groups(name='A New Group')
    group.save()
    dbsession.commit()

def test_memberships_relation(dbsession):
    """ Groups can have Memberships relations. """
    profile1 = profiles.Profiles(full_name='92e17a59 740480af51b5', email='6b7d@4c4b.b33d')
    membership1 = memberships.Memberships(profile=profile1)

    profile2 = profiles.Profiles(full_name='0464e813 ddaefbf8d308', email='b377@4a38.a54e')