  from django.test.client import RequestFactory
  from django.utils import unittest
  from rest_framework import generics, status
  from rest_framework.tests.models import FilterableItem, BasicModel
  
  factory = RequestFactory()
  
  
  if django_filters:
 
</s> remove import django_filters
 </s> add  </s> remove import django_filters
 </s> add 
from rest_framework.compat import django_filters
  from django.test.client import RequestFactory
  from django.utils import unittest
  from rest_framework import generics, status
from rest_framework.compat import django_filters
  from rest_framework.tests.models import FilterableItem, BasicModel
  
  factory = RequestFactory()
  
  
  if django_filters:
keep keep add keep keep keep keep keep keep
 Make filtering optional, and pluggable. 
rest_framework/tests/filterset.py