summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-02-06 19:00:32 -0800
committerTim Graham <timograham@gmail.com>2019-02-06 22:00:32 -0500
commitaf1434329fbdb295870301bd7e16e18fea95492e (patch)
tree72a929652309b29833a13bec86f2e14d5ee00ad7
parent80f4ecc64751d5cf13a7233aa520209fee4757c8 (diff)
Removed unnecessary type() calls for class methods.
-rw-r--r--django/contrib/sessions/backends/file.py2
-rw-r--r--tests/custom_lookups/tests.py7
2 files changed, 3 insertions, 6 deletions
diff --git a/django/contrib/sessions/backends/file.py b/django/contrib/sessions/backends/file.py
index 60c10d6959..e75195f222 100644
--- a/django/contrib/sessions/backends/file.py
+++ b/django/contrib/sessions/backends/file.py
@@ -18,7 +18,7 @@ class SessionStore(SessionBase):
Implement a file based session store.
"""
def __init__(self, session_key=None):
- self.storage_path = type(self)._get_storage_path()
+ self.storage_path = self._get_storage_path()
self.file_prefix = settings.SESSION_COOKIE_NAME
super().__init__(session_key)
diff --git a/tests/custom_lookups/tests.py b/tests/custom_lookups/tests.py
index 670f90f36c..5c9ee5c5ef 100644
--- a/tests/custom_lookups/tests.py
+++ b/tests/custom_lookups/tests.py
@@ -234,17 +234,14 @@ class LookupTests(TestCase):
__exact=None is transformed to __isnull=True if a custom lookup class
with lookup_name != 'exact' is registered as the `exact` lookup.
"""
- class CustomExactLookup(models.Lookup):
- lookup_name = 'somecustomlookup'
-
field = Author._meta.get_field('birthdate')
OldExactLookup = field.get_lookup('exact')
author = Author.objects.create(name='author', birthdate=None)
try:
- type(field).register_lookup(Exactly, 'exact')
+ field.register_lookup(Exactly, 'exact')
self.assertEqual(Author.objects.get(birthdate__exact=None), author)
finally:
- type(field).register_lookup(OldExactLookup, 'exact')
+ field.register_lookup(OldExactLookup, 'exact')
def test_basic_lookup(self):
a1 = Author.objects.create(name='a1', age=1)