title: How can I write a unit test with pagination in django
body: <p>I want to write unit tests for my project in django rest framwork but I can not compare my res.data with my serializer.data
  This is my json for one object Brand :</p>
  
  <pre><code>{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
      {
        "url": "http://localhost:8000/shops/tags/1/",
        "id": 1,
        "name": "PS4",
        "link": "https://www.playstation.com"
      }
    ]
  }
  </code></pre>
  
  <p>This is my unit test :</p>
  
  <pre class="lang-py prettyprint-override"><code>BRANDS_URL = reverse('brands-list')
      def test_retrieve_brand_list(self):
          """Test retrieving a list of brands"""
          Brand.objects.create(name='Bestbuy', link='https://bestbuy.ca')
          Brand.objects.create(name='Amazon', link='https://amazon.ca')
          res = self.client.get(BRANDS_URL)
  
          brands = Brand.objects.all().order_by('-name')
  
          context = {'request': RequestFactory().get('/')}
          serializer = BrandsSerializer(brands, context=context, many=True)
  
          self.assertEqual(res.status_code, status.HTTP_200_OK)
          self.assertEqual(res.data, serializer.data)
  </code></pre>
  
  <p>My serializer : </p>
  
  <pre class="lang-py prettyprint-override"><code>class BrandsSerializer(serializers.HyperlinkedModelSerializer):
  
      class Meta:
          model = Brand
          fields = ('url', 'id', 'name', 'link')
  </code></pre>
  
  <p>How I can add count, next, previous and results to my serializer.data ?
  How I can have a serializer.data like res.data ?
  I'm a little lost, I can not find a solution</p>