def test_retrieve_spls_filter_by_drug_name(self):
    'Test retrieving spls by drug name filter'
    name = 'Ciprofloxacin'
    res = self.client.get(SPL_URL, {'product_name': name}, format='json')
    serializer = SplSerializer(Spl.objects.filter(products__name=name).distinct(), many=True)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(serializer.data, res.data['results'])
Test retrieving spls by drug name filter
def test_retrieve_spls_filter_by_drug_name(self):
    
    name = 'Ciprofloxacin'
    res = self.client.get(SPL_URL, {'product_name': name}, format='json')
    serializer = SplSerializer(Spl.objects.filter(products__name=name).distinct(), many=True)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(serializer.data, res.data['results'])