# Path: tests/base.py
# class APITestCase(APITestCase):
#     client_class = APIClient


from .base import APITestCase
from django.core.exceptions import ImproperlyConfigured
    from django.urls import include
    from django.conf.urls import include
        from wq.db import rest
        from tests.conflict_app.models import Item
        from wq.db import rest
        from tests.conflict_app.models import TestModel
        from wq.db import rest
try:
except ImportError:


class RestRouterTestCase(APITestCase):
    def test_rest_model_conflict(self):

        # Register model with same name as existing model
        with self.assertRaises(ImproperlyConfigured) as e:
            rest.router.register_model(Item, fields="__all__")
        self.assertEqual(
            e.exception.args[0],
            "Could not register <class 'tests.conflict_app.models.Item'>: "
            "the name 'item' was already registered for "
            "<class 'tests.rest_app.models.Item'>"
        )

# Path: tests/base.py
# class APITestCase(APITestCase):
#     client_class = APIClient


# Path: tests/test_router.py
from .base import APITestCase
from django.core.exceptions import ImproperlyConfigured
    from django.urls import include
    from django.conf.urls import include
        from wq.db import rest
        from tests.conflict_app.models import Item
        from wq.db import rest
        from tests.conflict_app.models import TestModel
        from wq.db import rest

try:
except ImportError:


class RestRouterTestCase(APITestCase):
    def test_rest_model_conflict(self):

        # Register model with same name as existing model
        with self.assertRaises(ImproperlyConfigured) as e:
            rest.router.register_model(Item, fields="__all__")
        self.assertEqual(
            e.exception.args[0],
            "Could not register <class 'tests.conflict_app.models.Item'>: "
            "the name 'item' was already registered for "
            "<class 'tests.rest_app.models.Item'>"
        )

        self.assertNotIn(Item, rest.router._models)