def test_thread_is_reindexed_on_username_change(self): search = ThreadMappingType.search() u = UserFactory(username="******") ThreadFactory(creator=u, title="Hello") self.refresh() eq_(search.query(post_title="hello")[0]["post_author_ord"], ["dexter"]) # Change the username and verify the index. u.username = "******" u.save() self.refresh() eq_(search.query(post_title="hello")[0]["post_author_ord"], ["walter"])
def test_thread_is_reindexed_on_username_change(self): search = ThreadMappingType.search() u = UserFactory(username='******') ThreadFactory(creator=u, title=u'Hello') self.refresh() eq_(search.query(post_title='hello')[0]['post_author_ord'], [u'dexter']) # Change the username and verify the index. u.username = '******' u.save() self.refresh() eq_(search.query(post_title='hello')[0]['post_author_ord'], [u'walter'])
def test_thread_is_reindexed_on_username_change(self): search = ThreadMappingType.search() u = UserFactory(username='******') ThreadFactory(creator=u, title='Hello') self.refresh() eq_(search.query(post_title='hello')[0]['post_author_ord'], ['dexter']) # Change the username and verify the index. u.username = '******' u.save() self.refresh() eq_(search.query(post_title='hello')[0]['post_author_ord'], ['walter'])
def test_question_is_reindexed_on_username_change(self): search = QuestionMappingType.search() u = UserFactory(username='******') QuestionFactory(creator=u, title='Hello') AnswerFactory(creator=u, content='I love you') self.refresh() eq_(search.query(question_title__match='hello')[0]['question_creator'], 'dexter') query = search.query(question_answer_content__match='love') eq_(query[0]['question_answer_creator'], ['dexter']) # Change the username and verify the index. u.username = '******' u.save() self.refresh() eq_(search.query(question_title__match='hello')[0]['question_creator'], 'walter') query = search.query(question_answer_content__match='love') eq_(query[0]['question_answer_creator'], ['walter'])
def test_question_is_reindexed_on_username_change(self): search = QuestionMappingType.search() u = UserFactory(username='******') QuestionFactory(creator=u, title=u'Hello') AnswerFactory(creator=u, content=u'I love you') self.refresh() eq_(search.query(question_title__match='hello')[0]['question_creator'], u'dexter') query = search.query(question_answer_content__match='love') eq_(query[0]['question_answer_creator'], [u'dexter']) # Change the username and verify the index. u.username = '******' u.save() self.refresh() eq_(search.query(question_title__match='hello')[0]['question_creator'], u'walter') query = search.query(question_answer_content__match='love') eq_(query[0]['question_answer_creator'], [u'walter'])
def test_question_is_reindexed_on_username_change(self): search = QuestionMappingType.search() u = UserFactory(username="******") QuestionFactory(creator=u, title="Hello") AnswerFactory(creator=u, content="I love you") self.refresh() eq_( search.query(question_title__match="hello")[0]["question_creator"], "dexter") query = search.query(question_answer_content__match="love") eq_(query[0]["question_answer_creator"], ["dexter"]) # Change the username and verify the index. u.username = "******" u.save() self.refresh() eq_( search.query(question_title__match="hello")[0]["question_creator"], "walter") query = search.query(question_answer_content__match="love") eq_(query[0]["question_answer_creator"], ["walter"])