      def test_get_list_view(self):
          """
          GET requests to ListCreateAPIView should return list of objects.
          """
          request = factory.get('/')
          response = self.list_view(request).render()
          self.assertEquals(response.status_code, status.HTTP_200_OK)
          self.assertEquals(response.data, self.data)
  
      def test_get_detail_view(self):
 
</s> remove         request = factory.get('/1')
 </s> add         request = factory.get('/manytomany/1/') </s> remove         model_meta = self.opts.model._meta
 </s> add         model_meta = model._meta </s> remove     def _get_default_view_name(self):
 </s> add     def _get_default_view_name(self, model): </s> remove     Base class for related model managers.
 </s> add     Mixin to convert a related field to a many related field. </s> remove             self.opts.view_name = self._get_default_view_name()
 </s> add             self.opts.view_name = self._get_default_view_name(self.opts.model)
        request = factory.get('/basic/')
        response = self.list_view(request).render()
        self.assertEquals(response.status_code, status.HTTP_200_OK)
        self.assertEquals(response.data, self.data)

    def test_get_detail_view(self):
        """
        GET requests to ListCreateAPIView should return list of objects.
        """
        request = factory.get('/basic/1')
        response = self.detail_view(request, pk=1).render()
        self.assertEquals(response.status_code, status.HTTP_200_OK)
        self.assertEquals(response.data, self.data[0])


class TestManyToManyHyperlinkedView(TestCase):
    urls = 'rest_framework.tests.hyperlinkedserializers'

    def setUp(self):
        """
        Create 3 BasicModel intances.
        """
        items = ['foo', 'bar', 'baz']
        anchors = []
        for item in items:
            anchor = Anchor(text=item)
            anchor.save()
            anchors.append(anchor)

        manytomany = ManyToManyModel()
        manytomany.save()
        manytomany.rel.add(*anchors)

        self.data = [{
            'url': 'http://testserver/manytomany/1/',
            'rel': [
                'http://testserver/anchor/1/',
                'http://testserver/anchor/2/',
                'http://testserver/anchor/3/',
            ]
        }]
        self.list_view = ManyToManyList.as_view()
        self.detail_view = ManyToManyDetail.as_view()

    def test_get_list_view(self):
        """
        GET requests to ListCreateAPIView should return list of objects.
        """
        request = factory.get('/manytomany/')
      def test_get_list_view(self):
          """
          GET requests to ListCreateAPIView should return list of objects.
          """
        request = factory.get('/basic/')
        response = self.list_view(request).render()
        self.assertEquals(response.status_code, status.HTTP_200_OK)
        self.assertEquals(response.data, self.data)

    def test_get_detail_view(self):
        """
        GET requests to ListCreateAPIView should return list of objects.
        """
        request = factory.get('/basic/1')
        response = self.detail_view(request, pk=1).render()
        self.assertEquals(response.status_code, status.HTTP_200_OK)
        self.assertEquals(response.data, self.data[0])


class TestManyToManyHyperlinkedView(TestCase):
    urls = 'rest_framework.tests.hyperlinkedserializers'

    def setUp(self):
        """
        Create 3 BasicModel intances.
        """
        items = ['foo', 'bar', 'baz']
        anchors = []
        for item in items:
            anchor = Anchor(text=item)
            anchor.save()
            anchors.append(anchor)

        manytomany = ManyToManyModel()
        manytomany.save()
        manytomany.rel.add(*anchors)

        self.data = [{
            'url': 'http://testserver/manytomany/1/',
            'rel': [
                'http://testserver/anchor/1/',
                'http://testserver/anchor/2/',
                'http://testserver/anchor/3/',
            ]
        }]
        self.list_view = ManyToManyList.as_view()
        self.detail_view = ManyToManyDetail.as_view()

    def test_get_list_view(self):
        """
        GET requests to ListCreateAPIView should return list of objects.
        """
        request = factory.get('/manytomany/')
          response = self.list_view(request).render()
          self.assertEquals(response.status_code, status.HTTP_200_OK)
          self.assertEquals(response.data, self.data)
  
      def test_get_detail_view(self):
keep keep keep keep replace keep keep keep keep keep
 Initial tests for hyperlinked relationships 
rest_framework/tests/hyperlinkedserializers.py