'Verify the data we are indexing.'

def test_data_in_index(self):

    u = UserFactory(username='r1cky', email='r@r.com', profile__name=u'Rick    R\xf3ss')
    r1 = ReplyFactory(user=u, twitter_username='r1cardo')
    r2 = ReplyFactory(user=u, twitter_username='r1cky')
    self.refresh()
    eq_(UserMappingType.search().count(), 1)
    data = UserMappingType.search()[0]
    eq_(data['username'], u.username)
    eq_(data['display_name'], u.profile.name)
    assert (r1.twitter_username in data['twitter_usernames'])
    assert (r2.twitter_username in data['twitter_usernames'])
    u = UserFactory(username='willkg', email='w@w.com', profile__name='Will    Cage')
    self.refresh()
    eq_(UserMappingType.search().count(), 2)
