def test_retrieve_spls_filter_by_schedule(self):
    'Test retrieving spls by schedule filter'
    schedule = 'CIV'
    res = self.client.get(SPL_URL, {'schedule': schedule}, format='json')
    serializer = SplSerializer(Spl.objects.filter(products__schedule=schedule).distinct(), many=True)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(serializer.data, res.data['results'])
Test retrieving spls by schedule filter
def test_retrieve_spls_filter_by_schedule(self):
    
    schedule = 'CIV'
    res = self.client.get(SPL_URL, {'schedule': schedule}, format='json')
    serializer = SplSerializer(Spl.objects.filter(products__schedule=schedule).distinct(), many=True)
    self.assertEqual(res.status_code, status.HTTP_200_OK)
    self.assertEqual(serializer.data, res.data['results'])