              ('Resource Instance', '/resources/1/')
          ]
  
  
  class ResolveModelTests(TestCase):
      """
      `_resolve_model` should return a Django model class given the
      provided argument is a Django model class itself, or a properly
      formatted string representation of one.
      """
      def test_resolve_django_model(self):
          resolved_model = _resolve_model(BasicModel)
          assert resolved_model == BasicModel
  
      def test_resolve_string_representation(self):
          resolved_model = _resolve_model('tests.BasicModel')
          assert resolved_model == BasicModel
  
      def test_resolve_unicode_representation(self):
          resolved_model = _resolve_model(six.text_type('tests.BasicModel'))
          assert resolved_model == BasicModel
  
      def test_resolve_non_django_model(self):
          with self.assertRaises(ValueError):
              _resolve_model(TestCase)
  
      def test_resolve_improper_string_representation(self):
          with self.assertRaises(ValueError):
              _resolve_model('BasicModel')
  
  
  class ResolveModelWithPatchedDjangoTests(TestCase):
      """
      Test coverage for when Django's `get_model` returns `None`.
  
      Under certain circumstances Django may return `None` with `get_model`:
      http://git.io/get-model-source
  
      It usually happens with circular imports so it is important that DRF
      excepts early, otherwise fault happens downstream and is much more
      difficult to debug.
  
      """
  
      def setUp(self):
          """Monkeypatch get_model."""
          self.get_model = rest_framework.compat.apps.get_model
  
          def get_model(app_label, model_name):
              return None
  
          rest_framework.compat.apps.get_model = get_model
  
      def tearDown(self):
          """Revert monkeypatching."""
          rest_framework.compat.apps.get_model = self.get_model
  
      def test_blows_up_if_model_does_not_resolve(self):
          with self.assertRaises(ImproperlyConfigured):
              _resolve_model('tests.BasicModel')
  
  
  class JsonFloatTests(TestCase):
      """
      Internaly, wrapped json functions should adhere to strict float handling
      """
  
 
</s> remove def _resolve_model(obj):
    """
    Resolve supplied `obj` to a Django model class.

    `obj` must be a Django model class itself, or a string
    representation of one.  Useful in situations like GH #1225 where
    Django may not have resolved a string-based reference to a model in
    another model's foreign key definition.

    String representations should have the format:
        'appname.ModelName'
    """
    if isinstance(obj, six.string_types) and len(obj.split('.')) == 2:
        app_name, model_name = obj.split('.')
        resolved_model = apps.get_model(app_name, model_name)
        if resolved_model is None:
            msg = "Django did not return a model for {0}.{1}"
            raise ImproperlyConfigured(msg.format(app_name, model_name))
        return resolved_model
    elif inspect.isclass(obj) and issubclass(obj, models.Model):
        return obj
    raise ValueError("{0} is not a Django model".format(obj))


 </s> add  </s> remove import inspect

 </s> add  </s> remove import rest_framework.utils.model_meta
from rest_framework.compat import _resolve_model
 </s> add  </s> remove from django.utils import six
 </s> add  </s> remove from django.core.exceptions import ImproperlyConfigured
 </s> add 
              ('Resource Instance', '/resources/1/')
          ]
  
  


























































  class JsonFloatTests(TestCase):
      """
      Internaly, wrapped json functions should adhere to strict float handling
      """
  
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Remove unused compat._resolve_model() (#5733)

Last use removed in c674687782ef96a3bb8466b412e99debd3d04f00. 
tests/test_utils.py