Skip to content

Commit d1a8e6b

Browse files
benspauldingacdha
authored andcommitted
Correct unittest imports from commit e37c1f3
1 parent e8a87ee commit d1a8e6b

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

test_haystack/elasticsearch_tests/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
from django.conf import settings
66

7-
from ..utils.unittest import SkipTest
7+
from ..utils import unittest
88

99
warnings.simplefilter('ignore', Warning)
1010

1111
def setup():
1212
try:
1313
from elasticsearch import Elasticsearch, ElasticsearchException
1414
except ImportError:
15-
raise SkipTest("elasticsearch-py not installed.")
15+
raise unittest.SkipTest("elasticsearch-py not installed.")
1616

1717
es = Elasticsearch(settings.HAYSTACK_CONNECTIONS['elasticsearch']['URL'])
1818
try:
1919
es.info()
2020
except ElasticsearchException as e:
21-
raise SkipTest("elasticsearch not running on %r" % settings.HAYSTACK_CONNECTIONS['elasticsearch']['URL'], e)
21+
raise unittest.SkipTest("elasticsearch not running on %r" % settings.HAYSTACK_CONNECTIONS['elasticsearch']['URL'], e)
2222

test_haystack/solr_tests/test_solr_backend.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from ..core.models import AFourthMockModel, AnotherMockModel, ASixthMockModel, MockModel
2424
from ..mocks import MockSearchResult
25-
from ..utils.unittest import skipIf, skipUnless
25+
from ..utils import unittest
2626

2727
test_pickling = True
2828

@@ -1318,7 +1318,7 @@ def test_round_trip(self):
13181318
self.assertEqual(result.sites, [3, 5, 1])
13191319

13201320

1321-
@skipUnless(test_pickling, 'Skipping pickling tests')
1321+
@unittest.skipUnless(test_pickling, 'Skipping pickling tests')
13221322
class LiveSolrPickleTestCase(TestCase):
13231323
fixtures = ['bulk_data.json']
13241324

@@ -1409,7 +1409,7 @@ def test_boost(self):
14091409
])
14101410

14111411

1412-
@skipIf(pysolr.__version__ < (3, 1, 1), 'content extraction requires pysolr > 3.1.0')
1412+
@unittest.skipIf(pysolr.__version__ < (3, 1, 1), 'content extraction requires pysolr > 3.1.0')
14131413
class LiveSolrContentExtractionTestCase(TestCase):
14141414
def setUp(self):
14151415
super(LiveSolrContentExtractionTestCase, self).setUp()

test_haystack/test_app_using_appconfig/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88

99
from .models import MicroBlogPost
10-
from ..utils.unittest import skipIf
10+
from ..utils import unittest
1111

1212

1313

14-
@skipIf(django.VERSION < (1, 7), 'AppConfig tests do not apply to Django versions before 1.7')
14+
@unittest.skipIf(django.VERSION < (1, 7), 'AppConfig tests do not apply to Django versions before 1.7')
1515
class AppConfigTests(TestCase):
1616
def test_index_collection(self):
1717
from haystack import connections

test_haystack/test_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from .mocks import MockSearchResult
1818
from .test_indexes import ReadQuerySetTestSearchIndex
19-
from ..utils import unittest
19+
from .utils import unittest
2020

2121

2222
class CaptureHandler(std_logging.Handler):

test_haystack/test_query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from django.test import TestCase
88
from django.test.utils import override_settings
99
from test_haystack.core.models import AFifthMockModel, AnotherMockModel, CharPKMockModel, MockModel
10-
from test_haystack.utils.unittest import skipUnless
10+
from test_haystack.utils import unittest
1111

1212
from haystack import connection_router, connections, indexes, reset_search_queries
1313
from haystack.backends import BaseSearchQuery, SQ
@@ -848,7 +848,7 @@ def test_dictionary_lookup(self):
848848
self.assertRaises(TypeError, lambda: self.esqs['count'])
849849

850850

851-
@skipUnless(test_pickling, 'Skipping pickling tests')
851+
@unittest.skipUnless(test_pickling, 'Skipping pickling tests')
852852
@override_settings(DEBUG=True)
853853
class PickleSearchQuerySetTestCase(TestCase):
854854
def setUp(self):

0 commit comments

Comments
 (0)