  class ModelViewTests(TestModelsTestCase):
      """Test the model views djangorestframework provides"""
      urls = 'djangorestframework.tests.modelviews'
  
      def test_creation(self):
          """Ensure that a model object can be created"""
          self.assertEqual(0, Group.objects.count())
  
          response = self.client.post('/groups/', {'name': 'foo'})
  
          self.assertEqual(response.status_code, 201)
          self.assertEqual(1, Group.objects.count())
 
</s> remove class ModelViewTests(TestModelsTestCase):
    """Test the model views djangorestframework provides"""
    urls = 'djangorestframework.tests.modelviews'
 </s> add # class ModelViewTests(TestModelsTestCase):
#     """Test the model views djangorestframework provides"""
#     urls = 'djangorestframework.tests.modelviews' </s> remove         response = self.client.post('/groups/', {'name': 'foo'})
 </s> add #         response = self.client.post('/groups/', {'name': 'foo'}) </s> remove         self.assertEqual(response.status_code, 201)
        self.assertEqual(1, Group.objects.count())
        self.assertEqual('foo', Group.objects.all()[0].name)
 </s> add #         self.assertEqual(response.status_code, 201)
#         self.assertEqual(1, Group.objects.count())
#         self.assertEqual('foo', Group.objects.all()[0].name) </s> remove     def test_creation_with_m2m_relation(self):
        """Ensure that a model object with a m2m relation can be created"""
        group = Group(name='foo')
        group.save()
        self.assertEqual(0, User.objects.count())
 </s> add #     def test_creation_with_m2m_relation(self):
#         """Ensure that a model object with a m2m relation can be created"""
#         group = Group(name='foo')
#         group.save()
#         self.assertEqual(0, User.objects.count()) </s> remove urlpatterns = patterns('',
    url(r'^users/$', ListOrCreateModelView.as_view(resource=UserResource), name='users'),
    url(r'^users/(?P<id>[0-9]+)/$', InstanceModelView.as_view(resource=UserResource)),
    url(r'^customusers/$', ListOrCreateModelView.as_view(resource=CustomUserResource), name='customusers'),
    url(r'^customusers/(?P<id>[0-9]+)/$', InstanceModelView.as_view(resource=CustomUserResource)),
    url(r'^groups/$', ListOrCreateModelView.as_view(resource=GroupResource), name='groups'),
    url(r'^groups/(?P<id>[0-9]+)/$', InstanceModelView.as_view(resource=GroupResource)),
)
 </s> add # urlpatterns = patterns('',
#     url(r'^users/$', ListOrCreateModelView.as_view(resource=UserResource), name='users'),
#     url(r'^users/(?P<id>[0-9]+)/$', InstanceModelView.as_view(resource=UserResource)),
#     url(r'^customusers/$', ListOrCreateModelView.as_view(resource=CustomUserResource), name='customusers'),
#     url(r'^customusers/(?P<id>[0-9]+)/$', InstanceModelView.as_view(resource=CustomUserResource)),
#     url(r'^groups/$', ListOrCreateModelView.as_view(resource=GroupResource), name='groups'),
#     url(r'^groups/(?P<id>[0-9]+)/$', InstanceModelView.as_view(resource=GroupResource)),
# )
#     def test_creation(self):
#         """Ensure that a model object can be created"""
#         self.assertEqual(0, Group.objects.count())
  class ModelViewTests(TestModelsTestCase):
      """Test the model views djangorestframework provides"""
      urls = 'djangorestframework.tests.modelviews'
  
#     def test_creation(self):
#         """Ensure that a model object can be created"""
#         self.assertEqual(0, Group.objects.count())
#     def test_creation(self):
#         """Ensure that a model object can be created"""
#         self.assertEqual(0, Group.objects.count())
#     def test_creation(self):
#         """Ensure that a model object can be created"""
#         self.assertEqual(0, Group.objects.count())
  
          response = self.client.post('/groups/', {'name': 'foo'})
  
          self.assertEqual(response.status_code, 201)
          self.assertEqual(1, Group.objects.count())
keep keep keep keep replace replace replace keep keep keep keep keep
 Drop out resources & mixins 
djangorestframework/tests/modelviews.py