Skip to content
Snippets Groups Projects
Commit 084999d6 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

adapt test, check banned word works

parent a010d6d7
No related branches found
No related tags found
No related merge requests found
......@@ -110,24 +110,31 @@ class AutoCompleteTestCase(TestCase):
@override_settings(AUTOCOMPLETE_MIN_LENGTH=1)
class MinLength1(test_helpers.ChangeAutoCompleteSettingsTestCase):
def test_it(self):
business_process.add_text_to_index("a bb ccc ddd")
business_process.add_text_to_index("z bb ccc ddd")
self.assertEqual(models.IndexedWord.objects.count(), 4)
@override_settings(AUTOCOMPLETE_MIN_LENGTH=2)
class MinLength2(test_helpers.ChangeAutoCompleteSettingsTestCase):
def test_it(self):
business_process.add_text_to_index("a bb ccc ddd")
business_process.add_text_to_index("z bb ccc ddd")
self.assertEqual(models.IndexedWord.objects.count(), 3)
@override_settings(AUTOCOMPLETE_MIN_LENGTH=3)
class MinLength3(test_helpers.ChangeAutoCompleteSettingsTestCase):
def test_it(self):
business_process.add_text_to_index("a bb ccc ddd")
business_process.add_text_to_index("z bb ccc ddd")
self.assertEqual(models.IndexedWord.objects.count(), 2)
@override_settings(AUTOCOMPLETE_MIN_LENGTH=1)
class BannedWord(test_helpers.ChangeAutoCompleteSettingsTestCase):
def test_it(self):
business_process.add_text_to_index("a A b c d")
self.assertEqual(models.IndexedWord.objects.count(), 3)
@override_settings(AUTOCOMPLETE_PERSISTENT_VARIABLE_GETTER_SETTER=None)
class NeedRebuildDefaultBehaviorTestCase(test_helpers.ChangeAutoCompleteSettingsTestCase):
def test_it(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment