def test_del_projects(self): projects = M.Project.query.find().all() index_tasks.add_projects([p._id for p in projects]) with mock.patch('allura.tasks.index_tasks.g.solr') as solr: index_tasks.del_projects([p.index_id() for p in projects]) assert solr.delete.call_count, 1 for project in projects: assert project.index_id() in solr.delete.call_args[1]['q']