|
@@ -7,7 +7,6 @@ transcript.
|
|
|
"""
|
|
|
from django.db import connection
|
|
|
from django.db.models import F, Value
|
|
|
-from django.test import modify_settings
|
|
|
|
|
|
from . import PostgreSQLSimpleTestCase, PostgreSQLTestCase
|
|
|
from .models import Character, Line, LineSavedSearch, Scene
|
|
@@ -103,7 +102,6 @@ class GrailTestData:
|
|
|
)
|
|
|
|
|
|
|
|
|
-@modify_settings(INSTALLED_APPS={"append": "django.contrib.postgres"})
|
|
|
class SimpleSearchTest(GrailTestData, PostgreSQLTestCase):
|
|
|
def test_simple(self):
|
|
|
searched = Line.objects.filter(dialogue__search="elbows")
|
|
@@ -140,7 +138,6 @@ class SimpleSearchTest(GrailTestData, PostgreSQLTestCase):
|
|
|
self.assertSequenceEqual(searched, [match])
|
|
|
|
|
|
|
|
|
-@modify_settings(INSTALLED_APPS={"append": "django.contrib.postgres"})
|
|
|
class SearchVectorFieldTest(GrailTestData, PostgreSQLTestCase):
|
|
|
def test_existing_vector(self):
|
|
|
Line.objects.update(dialogue_search_vector=SearchVector("dialogue"))
|
|
@@ -339,7 +336,6 @@ class MultipleFieldsTest(GrailTestData, PostgreSQLTestCase):
|
|
|
self.assertSequenceEqual(searched, [self.french])
|
|
|
|
|
|
|
|
|
-@modify_settings(INSTALLED_APPS={"append": "django.contrib.postgres"})
|
|
|
class TestCombinations(GrailTestData, PostgreSQLTestCase):
|
|
|
def test_vector_add(self):
|
|
|
searched = Line.objects.annotate(
|
|
@@ -462,7 +458,6 @@ class TestCombinations(GrailTestData, PostgreSQLTestCase):
|
|
|
Line.objects.filter(dialogue__search=None & SearchQuery("kneecaps"))
|
|
|
|
|
|
|
|
|
-@modify_settings(INSTALLED_APPS={"append": "django.contrib.postgres"})
|
|
|
class TestRankingAndWeights(GrailTestData, PostgreSQLTestCase):
|
|
|
def test_ranking(self):
|
|
|
searched = (
|
|
@@ -661,7 +656,6 @@ class SearchQueryTests(PostgreSQLSimpleTestCase):
|
|
|
self.assertEqual(str(query), expected_str)
|
|
|
|
|
|
|
|
|
-@modify_settings(INSTALLED_APPS={"append": "django.contrib.postgres"})
|
|
|
class SearchHeadlineTests(GrailTestData, PostgreSQLTestCase):
|
|
|
def test_headline(self):
|
|
|
searched = Line.objects.annotate(
|