'rebuild_index uses default index when --using is not present'

@patch(u'haystack.loading.ConnectionHandler.__getitem__')
@patch(u'haystack.management.commands.update_index.Command.update_backend')
def test_rebuild_index_default_using(self, m1, m2):

    call_command(u'rebuild_index', verbosity=0, interactive=False)
    self.assertEqual(len(settings.HAYSTACK_CONNECTIONS), m2.call_count)
    for k in settings.HAYSTACK_CONNECTIONS:
        self.assertTrue((call(k) in m2.call_args_list))
    m1.assert_any_call(u'core', u'default')
    m1.assert_any_call(u'core', u'whoosh')
