title: DRF testing Model Serializer - Django Restframework
body: <p>I am testing my Serializer model in django restframework with <code>APITestCase</code>.
  this is my structure :</p>
  
  <pre><code>class Usertest(APITestCase):
      def test_userprofile_create(self):
          user = User.objects.create(username='asghar', 
                                     password='4411652A', 
                                     email='ww@gmail.com',)
          profile = UserProfile.objects.create(fullname='asghariiiiii', 
                                               phonenumber='9121345432',
                                               address='bella', 
                                               user=user)
          user.user_profile = profile
          client = APIClient()
          request = client.get('/user/create/')
          data = UserCreateSerializer(user, 
                                      context={'request': request}).data
  
          url = reverse('user-create')
          response_create =client.post(url, data)
  </code></pre>
  
  <p>in my view permissions set to <code>AllowAny</code>.
  no need for login or force_authenticate.</p>
  
  <blockquote>
    <p>data = UserCreateSerializer(user, context={'request': request}).data AttributeError: 'HttpResponseNotFound' object has no attribute 'build_absolute_uri'</p>
  </blockquote>
  
  <p>as you can see error comes from creating <code>data</code> .first i tried to remove <code>context</code> but error comes with this title :</p>
  
  <blockquote>
    <p>AssertionError: <code>HyperlinkedIdentityField</code> requires the request in the serializer context. Add <code>context={'request': request}</code> when instantiating the serializer.</p>
  </blockquote>