def METHOD_NAME(self):
    model = DiscoverSavedQuery.objects.create(
        organization=self.org, name="Test query", query=self.query
    )
    model.set_projects(self.project_ids)
    model.set_projects([])
    assert (
        sorted(DiscoverSavedQueryProject.objects.all().values_list("project_id", flat=True))
        == []
    )
    model.set_projects([self.project_ids[0]])
    assert sorted(
        DiscoverSavedQueryProject.objects.all().values_list("project_id", flat=True)
    ) == [self.project_ids[0]]