コード例 #1
0
ファイル: search.py プロジェクト: learner9753/wolnelektury
 def test_diactricts_removal_pl(self):
     """ Tags should match both with and without national characters. """
     self.assertEqual(views.find_best_matches(u'ĘÓĄŚŁŻŹĆŃęóąśłżźćń'),
                      (self.polish_tag, ))
     self.assertEqual(views.find_best_matches(u'EOASLZZCNeoaslzzcn'),
                      (self.polish_tag, ))
     self.assertEqual(views.find_best_matches(u'eoaslzzcneoaslzzcn'),
                      (self.polish_tag, ))
コード例 #2
0
 def test_match_case_insensitive_unicode(self):
     """ Tag names should match case insensitive (unicode). """
     self.assertEqual(views.find_best_matches(u'tadeusz żeleński (boy)'), (self.unicode_tag,))
コード例 #3
0
 def test_match_case_insensitive(self):
     """ Tag names should match case insensitive. """
     self.assertEqual(views.find_best_matches(u'adam mickiewicz'), (self.author_tag,))
コード例 #4
0
 def test_match_by_prefix(self):
     """ Tags should be matched by prefix of words within it's name. """
     self.assertEqual(views.find_best_matches(u'Ada'), (self.author_tag,))
     self.assertEqual(views.find_best_matches(u'Mic'), (self.author_tag,))
     self.assertEqual(views.find_best_matches(u'Mickiewicz'), (self.author_tag,))
コード例 #5
0
 def test_one_letter_query(self):
     """ Check that one letter queries aren't permitted. """
     views.find_best_matches(u't')
コード例 #6
0
ファイル: search.py プロジェクト: learner9753/wolnelektury
 def test_one_letter_query(self):
     """ Check that one letter queries aren't permitted. """
     views.find_best_matches(u't')
コード例 #7
0
 def test_diactricts_query_removal_pl(self):
     """ Tags without national characters shouldn't be matched by queries with them. """
     self.assertEqual(views.find_best_matches(u'Adąm'), ())
コード例 #8
0
 def test_infix_doesnt_match(self):
     """ Searching for middle of a word shouldn't match. """
     self.assertEqual(views.find_best_matches(u'deusz'), tuple())
コード例 #9
0
ファイル: search.py プロジェクト: learner9753/wolnelektury
 def test_infix_doesnt_match(self):
     """ Searching for middle of a word shouldn't match. """
     self.assertEqual(views.find_best_matches(u'deusz'), tuple())
コード例 #10
0
ファイル: search.py プロジェクト: learner9753/wolnelektury
 def test_word_boundary(self):
     self.assertEqual(views.find_best_matches(u'SubWord'),
                      (self.author_tag, ))
     self.assertEqual(views.find_best_matches(u'[SubWord'),
                      (self.author_tag, ))
コード例 #11
0
ファイル: search.py プロジェクト: learner9753/wolnelektury
 def test_unrelated_search(self):
     self.assertEqual(views.find_best_matches(u'alamakota'), tuple())
     self.assertEqual(views.find_best_matches(u'Adama'), ())
コード例 #12
0
ファイル: search.py プロジェクト: learner9753/wolnelektury
 def test_match_case_insensitive_unicode(self):
     """ Tag names should match case insensitive (unicode). """
     self.assertEqual(views.find_best_matches(u'tadeusz żeleński (boy)'),
                      (self.unicode_tag, ))
コード例 #13
0
ファイル: search.py プロジェクト: learner9753/wolnelektury
 def test_match_case_insensitive(self):
     """ Tag names should match case insensitive. """
     self.assertEqual(views.find_best_matches(u'adam mickiewicz'),
                      (self.author_tag, ))
コード例 #14
0
ファイル: search.py プロジェクト: learner9753/wolnelektury
 def test_match_by_prefix(self):
     """ Tags should be matched by prefix of words within it's name. """
     self.assertEqual(views.find_best_matches(u'Ada'), (self.author_tag, ))
     self.assertEqual(views.find_best_matches(u'Mic'), (self.author_tag, ))
     self.assertEqual(views.find_best_matches(u'Mickiewicz'),
                      (self.author_tag, ))
コード例 #15
0
 def test_word_boundary(self):
     self.assertEqual(views.find_best_matches(u'SubWord'), (self.author_tag,))
     self.assertEqual(views.find_best_matches(u'[SubWord'), (self.author_tag,))
コード例 #16
0
ファイル: search.py プロジェクト: learner9753/wolnelektury
 def test_diactricts_query_removal_pl(self):
     """ Tags without national characters shouldn't be matched by queries with them. """
     self.assertEqual(views.find_best_matches(u'Adąm'), ())
コード例 #17
0
 def test_unrelated_search(self):
     self.assertEqual(views.find_best_matches(u'alamakota'), tuple())
     self.assertEqual(views.find_best_matches(u'Adama'), ())
コード例 #18
0
ファイル: search.py プロジェクト: learner9753/wolnelektury
 def test_sloppy(self):
     self.assertEqual(views.find_best_matches(u'Żelenski'),
                      (self.unicode_tag, ))
     self.assertEqual(views.find_best_matches(u'zelenski'),
                      (self.unicode_tag, ))
コード例 #19
0
 def test_diactricts_removal_pl(self):
     """ Tags should match both with and without national characters. """
     self.assertEqual(views.find_best_matches(u'ĘÓĄŚŁŻŹĆŃęóąśłżźćń'), (self.polish_tag,))
     self.assertEqual(views.find_best_matches(u'EOASLZZCNeoaslzzcn'), (self.polish_tag,))
     self.assertEqual(views.find_best_matches(u'eoaslzzcneoaslzzcn'), (self.polish_tag,))
コード例 #20
0
 def test_empty_query(self):
     """ Check that empty queries raise an error. """
     views.find_best_matches(u'')
コード例 #21
0
 def test_sloppy(self):
     self.assertEqual(views.find_best_matches(u'Żelenski'), (self.unicode_tag,))
     self.assertEqual(views.find_best_matches(u'zelenski'), (self.unicode_tag,))
コード例 #22
0
ファイル: search.py プロジェクト: learner9753/wolnelektury
 def test_empty_query(self):
     """ Check that empty queries raise an error. """
     views.find_best_matches(u'')