Skip to content

Commit 87a25e2

Browse files
committed
Tests: skip Solr content extraction with old PySolr
Until pysolr 3.1.1 ships there's no point in running the Solr content extraction tests because they'll fail: django-haystack/pysolr#104
1 parent b122a36 commit 87a25e2

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

tests/solr_tests/tests/test_solr_backend.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
# -*- coding: utf-8 -*-
2-
from __future__ import print_function
3-
from __future__ import unicode_literals
2+
from __future__ import print_function, unicode_literals
3+
44
import datetime
5-
from decimal import Decimal
6-
import os
75
import logging as std_logging
8-
9-
from mock import patch
6+
import os
7+
from decimal import Decimal
108

119
import pysolr
12-
1310
from django.conf import settings
1411
from django.test import TestCase
15-
from haystack import connections, reset_search_queries
16-
from haystack import indexes
17-
from haystack.inputs import AutoQuery, AltParser, Raw
12+
from django.utils.unittest import skipIf
13+
from mock import patch
14+
15+
from core.models import AFourthMockModel, AnotherMockModel, ASixthMockModel, MockModel
16+
from core.tests.mocks import MockSearchResult
17+
from haystack import connections, indexes, reset_search_queries
18+
from haystack.inputs import AltParser, AutoQuery, Raw
1819
from haystack.models import SearchResult
19-
from haystack.query import SearchQuerySet, RelatedSearchQuerySet, SQ
20+
from haystack.query import RelatedSearchQuerySet, SearchQuerySet, SQ
2021
from haystack.utils.loading import UnifiedIndex
21-
from core.models import (MockModel, AnotherMockModel,
22-
AFourthMockModel, ASixthMockModel)
23-
from core.tests.mocks import MockSearchResult
2422

2523
test_pickling = True
2624

@@ -1313,6 +1311,7 @@ def test_boost(self):
13131311
])
13141312

13151313

1314+
@skipIf(pysolr.__version__ < (3, 1, 1), 'content extraction requires pysolr > 3.1.0')
13161315
class LiveSolrContentExtractionTestCase(TestCase):
13171316
def setUp(self):
13181317
super(LiveSolrContentExtractionTestCase, self).setUp()

0 commit comments

Comments
 (0)