From 4defec5d4faf7c88faad007c261aabbd231cb1bb Mon Sep 17 00:00:00 2001 From: Mojken <13712961+Mojken@users.noreply.github.com> Date: Fri, 1 Apr 2022 10:00:11 +0200 Subject: [PATCH] Drop unused modules (#98) --- djedi/__init__.py | 2 +- djedi/tests/compat.py | 23 ----------------------- djedi/tests/test_admin.py | 2 +- djedi/utils/encoding.py | 11 ----------- 4 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 djedi/tests/compat.py delete mode 100644 djedi/utils/encoding.py diff --git a/djedi/__init__.py b/djedi/__init__.py index 81c35d34..1baba01f 100644 --- a/djedi/__init__.py +++ b/djedi/__init__.py @@ -17,7 +17,7 @@ def get_version(version=None): main = ".".join(str(x) for x in version[:parts]) sub = "" - if version[3] != "final": + if version[3] != "final": # pragma: no cover mapping = {"alpha": "a", "beta": "b", "rc": "c"} sub = mapping[version[3]] + str(version[4]) diff --git a/djedi/tests/compat.py b/djedi/tests/compat.py deleted file mode 100644 index ec4196cd..00000000 --- a/djedi/tests/compat.py +++ /dev/null @@ -1,23 +0,0 @@ -import django - - -def cmpt_context(context): - if django.VERSION >= (1, 8): - return context - - from django.template import Context - - return Context(context) - - -if django.VERSION < (1, 8): - from django.template.loader import get_template_from_string -else: - # Django 1.8+ has multiple template engines, we only test Django's for now. - from django.template import engines - - def get_template_from_string(template_code): - return engines["django"].from_string(template_code) - - -__all__ = ["cmpt_context", "get_template_from_string"] diff --git a/djedi/tests/test_admin.py b/djedi/tests/test_admin.py index c9558716..ff0ebf18 100644 --- a/djedi/tests/test_admin.py +++ b/djedi/tests/test_admin.py @@ -41,7 +41,7 @@ def test_cms(self): self.assertIn(b'document.domain = "foobar.se"', response.content) @skip("Unfinished admin view is hidden") - def test_django_admin(self): + def test_django_admin(self): # pragma: no cover # Patch django admin index from django.contrib.admin.templatetags.log import AdminLogNode diff --git a/djedi/utils/encoding.py b/djedi/utils/encoding.py deleted file mode 100644 index c8d38d88..00000000 --- a/djedi/utils/encoding.py +++ /dev/null @@ -1,11 +0,0 @@ -import django - -if django.VERSION < (1, 5): - from django.utils.encoding import smart_str, smart_unicode -else: - from django.utils.encoding import ( - smart_bytes as smart_str, - smart_text as smart_unicode, - ) - -__all__ = ["smart_str", "smart_unicode"]