class IntegrationTestCase(TestCase):

    def rebuild_index(self):
        call_command('rebuild_index', verbosity=0, interactive=False)


class IntegrationTestUsers(IntegrationTestCase):
    pass
Unit testing elastic search inside Django app