      def test_create_comment(self):
  
          data = {
              'text': 'A test comment',
              'blog_post_url': '/posts/1/'
          }
  
          request = factory.post('/comments/', data=data)
          response = self.create_view(request).render()
          self.assertEqual(response.status_code, 201)
 
</s> remove from django.core.urlresolvers import resolve
 </s> add from django.core.urlresolvers import resolve, get_script_prefix
            'blog_post_url': 'http://testserver/posts/1/'
      def test_create_comment(self):
  
          data = {
              'text': 'A test comment',
            'blog_post_url': 'http://testserver/posts/1/'
          }
  
          request = factory.post('/comments/', data=data)
          response = self.create_view(request).render()
          self.assertEqual(response.status_code, 201)
keep keep keep keep replace keep keep keep keep keep
 Allow use of absolute URLs when deserializing hyperlinked fields 
rest_framework/tests/hyperlinkedserializers.py