Remove dead code
This commit is contained in:
parent
ed9cc5d595
commit
03c9e84981
|
|
@ -5,7 +5,6 @@ import hashlib
|
|||
import inspect
|
||||
import io
|
||||
import json
|
||||
import os.path
|
||||
import re
|
||||
from decimal import Decimal, InvalidOperation
|
||||
from pathlib import Path
|
||||
|
|
@ -295,7 +294,7 @@ def getLogoImage(as_file: bool = False, custom: bool = True, backup: bool = True
|
|||
return None
|
||||
|
||||
|
||||
def getSplashScreen(custom=True):
|
||||
def getSplashScreen(custom: bool = True):
|
||||
"""Return the InvenTree splash screen, or a custom splash if available."""
|
||||
static_storage = StaticFilesStorage()
|
||||
|
||||
|
|
@ -316,24 +315,6 @@ def getCustomOption(reference: str):
|
|||
return settings.CUSTOMIZE.get(reference, None)
|
||||
|
||||
|
||||
def TestIfImageURL(url):
|
||||
"""Test if an image URL (or filename) looks like a valid image format.
|
||||
|
||||
Simply tests the extension against a set of allowed values
|
||||
"""
|
||||
return os.path.splitext(os.path.basename(url))[-1].lower() in [
|
||||
'.jpg',
|
||||
'.jpeg',
|
||||
'.j2k',
|
||||
'.png',
|
||||
'.bmp',
|
||||
'.tif',
|
||||
'.tiff',
|
||||
'.webp',
|
||||
'.gif',
|
||||
]
|
||||
|
||||
|
||||
def str2bool(text, test=True) -> bool:
|
||||
"""Test if a string 'looks' like a boolean value.
|
||||
|
||||
|
|
|
|||
|
|
@ -642,14 +642,6 @@ class TestHelpers(TestCase):
|
|||
InvenTree.helpers_model.construct_absolute_url(url), expected
|
||||
)
|
||||
|
||||
def test_image_url(self):
|
||||
"""Test if a filename looks like an image."""
|
||||
for name in ['ape.png', 'bat.GiF', 'apple.WeBP', 'BiTMap.Bmp']:
|
||||
self.assertTrue(helpers.TestIfImageURL(name))
|
||||
|
||||
for name in ['no.doc', 'nah.pdf', 'whatpng']:
|
||||
self.assertFalse(helpers.TestIfImageURL(name))
|
||||
|
||||
def test_str2bool(self):
|
||||
"""Test string to boolean conversion."""
|
||||
for s in ['yes', 'Y', 'ok', '1', 'OK', 'Ok', 'tRuE', 'oN']:
|
||||
|
|
|
|||
Loading…
Reference in New Issue