def METHOD_NAME(self):
    alert = self.factory.create_alert()
    query = self.factory.create_query(
        data_source=self.factory.create_data_source(group=self.factory.create_group())
    )
    alert2 = self.factory.create_alert(query_rel=query)
    rv = self.make_request("get", "/api/alerts")
    self.assertEqual(rv.status_code, 200)
    alert_ids = [a["id"] for a in rv.json]
    self.assertIn(alert.id, alert_ids)
    self.assertNotIn(alert2.id, alert_ids)