Simplified super() calls
This commit is contained in:
parent
97f54ed37c
commit
90f5bc8c14
|
@ -25,7 +25,7 @@ XAPIAN_VERSION = [int(x) for x in xapian.__version__.split('.')]
|
|||
|
||||
class XapianSearchResult(SearchResult):
|
||||
def __init__(self, app_label, model_name, pk, score, **kwargs):
|
||||
super(XapianSearchResult, self).__init__(app_label, model_name, pk, score, **kwargs)
|
||||
super().__init__(app_label, model_name, pk, score, **kwargs)
|
||||
self._model = apps.get_model('xapian_tests', model_name)
|
||||
|
||||
|
||||
|
@ -106,7 +106,7 @@ class BackendIndexationTestCase(HaystackBackendTestCase, TestCase):
|
|||
return CompleteBlogEntryIndex()
|
||||
|
||||
def setUp(self):
|
||||
super(BackendIndexationTestCase, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
tag1 = MockTag.objects.create(name='tag')
|
||||
tag2 = MockTag.objects.create(name='tag-tag')
|
||||
|
@ -303,7 +303,7 @@ class BackendFeaturesTestCase(HaystackBackendTestCase, TestCase):
|
|||
return entry
|
||||
|
||||
def setUp(self):
|
||||
super(BackendFeaturesTestCase, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.sample_objs = []
|
||||
|
||||
|
@ -700,7 +700,7 @@ class IndexationNGramTestCase(HaystackBackendTestCase, TestCase):
|
|||
return XapianNGramIndex()
|
||||
|
||||
def setUp(self):
|
||||
super(IndexationNGramTestCase, self).setUp()
|
||||
super().setUp()
|
||||
mock = BlogEntry()
|
||||
mock.id = 1
|
||||
mock.author = 'david'
|
||||
|
@ -747,7 +747,7 @@ class IndexationEdgeNGramTestCase(HaystackBackendTestCase, TestCase):
|
|||
return XapianEdgeNGramIndex()
|
||||
|
||||
def setUp(self):
|
||||
super(IndexationEdgeNGramTestCase, self).setUp()
|
||||
super().setUp()
|
||||
mock = BlogEntry()
|
||||
mock.id = 1
|
||||
mock.author = 'david'
|
||||
|
@ -793,7 +793,7 @@ class IndexationDjangoContentTypeTestCase(HaystackBackendTestCase, TestCase):
|
|||
return DjangoContentTypeIndex()
|
||||
|
||||
def setUp(self):
|
||||
super(IndexationDjangoContentTypeTestCase, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
entry1 = ContentType(model='DjangoContentType')
|
||||
entry1.save()
|
||||
|
|
|
@ -21,7 +21,7 @@ class InterfaceTestCase(TestCase):
|
|||
"""
|
||||
|
||||
def setUp(self):
|
||||
super(InterfaceTestCase, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
types_names = ['book', 'magazine', 'article']
|
||||
texts = ['This is a huge text',
|
||||
|
@ -58,7 +58,7 @@ class InterfaceTestCase(TestCase):
|
|||
def tearDown(self):
|
||||
Document.objects.all().delete()
|
||||
#self.backend.clear()
|
||||
super(InterfaceTestCase, self).tearDown()
|
||||
super().tearDown()
|
||||
|
||||
def test_count(self):
|
||||
self.assertEqual(self.queryset.count(), Document.objects.count())
|
||||
|
|
|
@ -25,7 +25,7 @@ class XapianSearchQueryTestCase(HaystackBackendTestCase, TestCase):
|
|||
return MockQueryIndex()
|
||||
|
||||
def setUp(self):
|
||||
super(XapianSearchQueryTestCase, self).setUp()
|
||||
super().setUp()
|
||||
self.sq = connections['default'].get_query()
|
||||
|
||||
def test_all(self):
|
||||
|
@ -258,7 +258,7 @@ class SearchQueryTestCase(HaystackBackendTestCase, TestCase):
|
|||
return MockSearchIndex()
|
||||
|
||||
def setUp(self):
|
||||
super(SearchQueryTestCase, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.backend.update(self.index, MockModel.objects.all())
|
||||
|
||||
|
@ -379,7 +379,7 @@ class LiveSearchQuerySetTestCase(HaystackBackendTestCase, TestCase):
|
|||
return MockSearchIndex()
|
||||
|
||||
def setUp(self):
|
||||
super(LiveSearchQuerySetTestCase, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.backend.update(self.index, MockModel.objects.all())
|
||||
self.sq = connections['default'].get_query()
|
||||
|
@ -411,7 +411,7 @@ class BoostFieldTestCase(HaystackBackendTestCase, TestCase):
|
|||
return BoostMockSearchIndex()
|
||||
|
||||
def setUp(self):
|
||||
super(BoostFieldTestCase, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.sample_objs = []
|
||||
for i in range(1, 5):
|
||||
|
|
|
@ -182,7 +182,7 @@ class XapianSearchBackend(BaseSearchBackend):
|
|||
|
||||
Also sets the stemming language to be used to `language`.
|
||||
"""
|
||||
super(XapianSearchBackend, self).__init__(connection_alias, **connection_options)
|
||||
super().__init__(connection_alias, **connection_options)
|
||||
|
||||
if not 'PATH' in connection_options:
|
||||
raise ImproperlyConfigured("You must specify a 'PATH' in your settings for connection '%s'."
|
||||
|
@ -1236,7 +1236,7 @@ class XapianSearchQuery(BaseSearchQuery):
|
|||
``SearchBackend`` itself.
|
||||
"""
|
||||
def build_params(self, *args, **kwargs):
|
||||
kwargs = super(XapianSearchQuery, self).build_params(*args, **kwargs)
|
||||
kwargs = super().build_params(*args, **kwargs)
|
||||
|
||||
if self.end_offset is not None:
|
||||
kwargs['end_offset'] = self.end_offset - self.start_offset
|
||||
|
|
Loading…
Reference in New Issue