class IntegrationTestUsers(IntegrationTestCase):

    def test_search_users_in_elasticsearch(self):
        user = mommy.make(User, first_name='John', last_name='Smith')
user = mommy.make(User, first_name='Andy', last_name='Smith')
user = mommy.make(User, first_name='Jane', last_name='Smith')
self.rebuild_index()
Модульное тестирование эластичного поиска внутри приложения Django