'Users should be able to filter by the experiment_id and key fields.'

def test_list_filtering(self):

    url = reverse('api_experiments:v0:data-list')
    user = UserFactory()
    self.client.login(username=user.username, password=UserFactory._DEFAULT_PASSWORD)
    experiment_id = 1
    ExperimentDataFactory()
    ExperimentDataFactory(user=user)
    data = ExperimentDataFactory.create_batch(3, user=user, experiment_id=experiment_id)
    qs = urllib.urlencode({'experiment_id': experiment_id})
    response = self.client.get('{url}?{qs}'.format(url=url, qs=qs))
    self.assertEqual(response.status_code, 200)
    self.assertEqual(response.data['results'], ExperimentDataSerializer(data, many=True).data)
    datum = data[0]
    qs = urllib.urlencode({'key': datum.key})
    response = self.client.get('{url}?{qs}'.format(url=url, qs=qs))
    self.assertEqual(response.status_code, 200)
    self.assertEqual(response.data['results'], ExperimentDataSerializer([datum], many=True).data)
    qs = urllib.urlencode({'experiment_id': experiment_id, 'key': datum.key})
    response = self.client.get('{url}?{qs}'.format(url=url, qs=qs))
    self.assertEqual(response.status_code, 200)
    self.assertEqual(response.data['results'], ExperimentDataSerializer([datum], many=True).data)
