# Path: models/bases.py
# NO_VALUE = sa_symbol('NO_VALUE')
# class Base(object):
# class BaseModel(Base):
#     def __repr__(self):
#     def __str__(self):
#     def __tablename__(cls):  # pylint: disable=no-self-argument
#     def delete(self):
#     def _prepare_conditions(cls, conditions):
#     def get_all(cls, conditions=None):
#     def get_by_pk(cls, the_id):
#     def save(self, flush=False):
# 
# Path: ourapi/exceptions.py
# class NotFound(JSONAPIError, werkzeug.exceptions.NotFound):
#     """ 404 Not Found: Resource doesn't exist. """
#     pass


    from builtins import *  # pylint: disable=unused-wildcard-import,redefined-builtin,wildcard-import
from models import bases
from ourapi.exceptions import NotFound
    import sys
import datetime
import warnings
import pytest
import sqlalchemy as sa
import ourapi
import ourmarshmallow
    response = resource.get(20)
    assert response == {'data': [{'attributes': {'name': 'Impossible Stand'},
                                  'id': '21',
                                  'links': {'self': '/persons/21'},
                                  'meta': {'modified_at': '2017-08-14T17:50:19+00:00'},
                                  # pylint: disable=line-too-long
                                  'relationships': {'children': {'links': {'related': '/persons/21/children',
                                                                           'self': '/persons/21/relationships/children'}},
                                                    'parent': {'links': {'related': '/persons/21/parent',
                                                                         'self': '/persons/21/relationships/parent'}}},
                                  'type': 'persons'},
                                 {'attributes': {'name': 'Carry Cool'},
                                  'id': '22',
                                  'links': {'self': '/persons/22'},
                                  'meta': {'modified_at': '2017-08-14T17:50:19+00:00'},
                                  # pylint: disable=line-too-long
                                  'relationships': {'children': {'links': {'related': '/persons/22/children',
                                                                           'self': '/persons/22/relationships/children'}},
                                                    'parent': {'links': {'related': '/persons/22/parent',
                                                                         'self': '/persons/22/relationships/parent'}}},
                                  'type': 'persons'}],
                        'links': {'self': '/persons/20/children'}}

def test_model_missing_relation(dbsession, testdata):  # pylint: disable=unused-argument,redefined-outer-name
    """
    Model ID 999 doesn't exist so this should return a 404 Not Found exception.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    :param list(str) testdata: pytest fixture listing test data tokens.
    """
    resource = ChildrenRelation()

# Path: models/bases.py
# NO_VALUE = sa_symbol('NO_VALUE')
# class Base(object):
# class BaseModel(Base):
#     def __repr__(self):
#     def __str__(self):
#     def __tablename__(cls):  # pylint: disable=no-self-argument
#     def delete(self):
#     def _prepare_conditions(cls, conditions):
#     def get_all(cls, conditions=None):
#     def get_by_pk(cls, the_id):
#     def save(self, flush=False):
# 
# Path: ourapi/exceptions.py
# class NotFound(JSONAPIError, werkzeug.exceptions.NotFound):
#     """ 404 Not Found: Resource doesn't exist. """
#     pass


# Path: tests/ourapi/test_relations.py
    from builtins import *  # pylint: disable=unused-wildcard-import,redefined-builtin,wildcard-import
from models import bases
from ourapi.exceptions import NotFound
    import sys
import datetime
import warnings
import pytest
import sqlalchemy as sa
import ourapi
import ourmarshmallow

    response = resource.get(20)
    assert response == {'data': [{'attributes': {'name': 'Impossible Stand'},
                                  'id': '21',
                                  'links': {'self': '/persons/21'},
                                  'meta': {'modified_at': '2017-08-14T17:50:19+00:00'},
                                  # pylint: disable=line-too-long
                                  'relationships': {'children': {'links': {'related': '/persons/21/children',
                                                                           'self': '/persons/21/relationships/children'}},
                                                    'parent': {'links': {'related': '/persons/21/parent',
                                                                         'self': '/persons/21/relationships/parent'}}},
                                  'type': 'persons'},
                                 {'attributes': {'name': 'Carry Cool'},
                                  'id': '22',
                                  'links': {'self': '/persons/22'},
                                  'meta': {'modified_at': '2017-08-14T17:50:19+00:00'},
                                  # pylint: disable=line-too-long
                                  'relationships': {'children': {'links': {'related': '/persons/22/children',
                                                                           'self': '/persons/22/relationships/children'}},
                                                    'parent': {'links': {'related': '/persons/22/parent',
                                                                         'self': '/persons/22/relationships/parent'}}},
                                  'type': 'persons'}],
                        'links': {'self': '/persons/20/children'}}

def test_model_missing_relation(dbsession, testdata):  # pylint: disable=unused-argument,redefined-outer-name
    """
    Model ID 999 doesn't exist so this should return a 404 Not Found exception.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    :param list(str) testdata: pytest fixture listing test data tokens.
    """
    resource = ChildrenRelation()

    with pytest.raises(NotFound):