def METHOD_NAME(self):
    kafka_seq = get_topic_offset(topics.APP)
    couch_seq = get_current_seq(Application.get_db())
    # Build #1, manually generated
    app = self._create_app('test-prune-app')
    build1 = app.make_build()
    build1.save()
    self.assertFalse(build1.is_auto_generated)
    # Build #2, auto-generated
    app.save()
    autogenerate_build(app, 'username')
    # Build #3, manually generated
    app.save()
    build3 = app.make_build()
    build3.save()
    # All 3 builds should show up in ES
    self.refresh_elasticsearch(kafka_seq, couch_seq)
    build_ids_in_es = AppES().domain(self.domain).is_build().values_list('_id', flat=True)
    self.assertEqual(len(build_ids_in_es), 3)
    # prune, which should delete the autogenerated build
    prune_auto_generated_builds(self.domain, app.id)
    # Build2 should no longer be in ES
    self.refresh_elasticsearch(kafka_seq, couch_seq)
    build_ids_in_es = AppES().domain(self.domain).is_build().values_list('_id', flat=True)
    self.assertItemsEqual(build_ids_in_es, [build1._id, build3._id])