Example #1
0
 def test_multiple_project(self):
     skip_test()
     p1 = self._prj("test_1")
     p2 = self._prj("test_2")
     iss1 = ProjectIssue.add(title='title1', description='desc1',
                             creator='owner', project=p1.id)
     iss2 = ProjectIssue.add(title='title1', description='desc1',
                             creator='owner', project=p2.id)
     IssueSearch.index_a_project_issue(p1)
     IssueSearch.index_a_project_issue(p2)
     res = IssueSearch.search_a_phrase('title1', p1.id)
     res = SearchEngine.decode(res, ('issue_id',))
     res = [id for id, in res]
     assert len(res) == 1
     assert res[0] == iss1.id
     res = IssueSearch.search_a_phrase('title1', p2.id)
     res = SearchEngine.decode(res, ('issue_id',))
     res = [id for id, in res]
     assert len(res) == 1
     assert res[0] == iss2.id
Example #2
0
 def test_single_project(self):
     skip_test()
     p = self._prj("test")
     iss1 = ProjectIssue.add(title='title1', description='desc1',
                             creator='owner', project=p.id)
     IssueSearch.index_a_project_issue(p)
     res = IssueSearch.search_a_phrase('owner', p.id)
     res = SearchEngine.decode(res, ('issue_id',))
     res = [id for id, in res]
     assert len(res) == 1
     assert res[0] == iss1.id
     iss2 = ProjectIssue.add(title='title2', description='desc2',
                             creator='owner', project=p.id)
     IssueSearch.index_a_project_issue(p)
     res = IssueSearch.search_a_phrase('owner', p.id)
     res = SearchEngine.decode(res, ('issue_id',))
     res = [id for id, in res]
     assert len(res) == 2
     assert iss1.id in res
     assert iss2.id in res
Example #3
0
 def test_multiple_project(self):
     skip_test()
     p1 = self._prj("test_1")
     p2 = self._prj("test_2")
     iss1 = ProjectIssue.add(title='title1',
                             description='desc1',
                             creator='owner',
                             project=p1.id)
     iss2 = ProjectIssue.add(title='title1',
                             description='desc1',
                             creator='owner',
                             project=p2.id)
     IssueSearch.index_a_project_issue(p1)
     IssueSearch.index_a_project_issue(p2)
     res = IssueSearch.search_a_phrase('title1', p1.id)
     res = SearchEngine.decode(res, ('issue_id', ))
     res = [id for id, in res]
     assert len(res) == 1
     assert res[0] == iss1.id
     res = IssueSearch.search_a_phrase('title1', p2.id)
     res = SearchEngine.decode(res, ('issue_id', ))
     res = [id for id, in res]
     assert len(res) == 1
     assert res[0] == iss2.id
Example #4
0
 def test_single_project(self):
     skip_test()
     p = self._prj("test")
     iss1 = ProjectIssue.add(title='title1',
                             description='desc1',
                             creator='owner',
                             project=p.id)
     IssueSearch.index_a_project_issue(p)
     res = IssueSearch.search_a_phrase('owner', p.id)
     res = SearchEngine.decode(res, ('issue_id', ))
     res = [id for id, in res]
     assert len(res) == 1
     assert res[0] == iss1.id
     iss2 = ProjectIssue.add(title='title2',
                             description='desc2',
                             creator='owner',
                             project=p.id)
     IssueSearch.index_a_project_issue(p)
     res = IssueSearch.search_a_phrase('owner', p.id)
     res = SearchEngine.decode(res, ('issue_id', ))
     res = [id for id, in res]
     assert len(res) == 2
     assert iss1.id in res
     assert iss2.id in res