#29084: Skip postgres_tests's SimpleSearchTest's that require 'english_stem'
configuration if the machine's configuration is different
-------------------------------------+-------------------------------------
Reporter: Дилян Палаузов | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: contrib.postgres | Version: 1.11
Severity: Normal | Resolution:
Keywords: tests postgresql | Triage Stage: Accepted
search |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Дилян Палаузов):
I propose passing explicitly 'english' as first parameter to both of
{{{to_tsvector/plainto_tsquery}}}:
{{{
diff --git a/tests/postgres_tests/test_search.py
b/tests/postgres_tests/test_search.py
index b93077f..b721f1f 100644
--- a/tests/postgres_tests/test_search.py
+++ b/tests/postgres_tests/test_search.py
@@ -88,11 +88,11 @@ class SimpleSearchTest(GrailTestData,
PostgreSQLTestCase):
self.assertSequenceEqual(searched, [self.verse1])
def test_non_exact_match(self):
- searched = Line.objects.filter(dialogue__search='hearts')
+ searched = Line.objects.annotate(search=SearchVector('dialogue',
config='english')).filter(search=SearchQuery('hearts', config='english'))
self.assertSequenceEqual(searched, [self.verse2])
def test_search_two_terms(self):
- searched = Line.objects.filter(dialogue__search='heart bowel')
+ searched = Line.objects.annotate(search=SearchVector('dialogue',
config='english')).filter(search=SearchQuery('heart bowel',
config='english'))
self.assertSequenceEqual(searched, [self.verse2])
def test_search_two_terms_with_partial_match(self):
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29084#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/072.d34c317d819e43bfaaf978e1b91dbe46%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.