def test_retrieve_spls_filter_by_inactive_ing(self):
    'Test retrieving a spl by inactive ingredient filter'
    inactive_ing = 'alcohol'
    res = self.client.get(SPL_URL, {'inactive_ingredient_name': inactive_ing}, format='json')
    serializer = SplSerializer(Spl.objects.filter(products__inactive_ingredients__name__icontains=inactive_ing).distinct(), many=True)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(serializer.data, res.data['results'])
Test retrieving a spl by inactive ingredient filter
def test_retrieve_spls_filter_by_inactive_ing(self):
    
    inactive_ing = 'alcohol'
    res = self.client.get(SPL_URL, {'inactive_ingredient_name': inactive_ing}, format='json')
    serializer = SplSerializer(Spl.objects.filter(products__inactive_ingredients__name__icontains=inactive_ing).distinct(), many=True)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(serializer.data, res.data['results'])