def test_retrieve_spls_filter_by_complex(self):
    'Test retrieving spls filtered by set & inactive ingredient'
    set_id = 'b88efb93-f1d1-4606-a669-6896f432a27f'
    inactive_ing = 'alcohol'
    res = self.client.get(SPL_URL, {'set_id': set_id, 'inactive_ingredient_name': inactive_ing}, format='json')
    serializer = SplSerializer(Spl.objects.filter(products__inactive_ingredients__name__icontains=inactive_ing, set__id=set_id).distinct(), many=True)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(len(res.data['results']), 1)
    self.assertEqual(serializer.data, res.data['results'])
Test retrieving spls filtered by set & inactive ingredient
def test_retrieve_spls_filter_by_complex(self):
    
    set_id = 'b88efb93-f1d1-4606-a669-6896f432a27f'
    inactive_ing = 'alcohol'
    res = self.client.get(SPL_URL, {'set_id': set_id, 'inactive_ingredient_name': inactive_ing}, format='json')
    serializer = SplSerializer(Spl.objects.filter(products__inactive_ingredients__name__icontains=inactive_ing, set__id=set_id).distinct(), many=True)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(len(res.data['results']), 1)
    self.assertEqual(serializer.data, res.data['results'])