forked from openlp/openlp
Fix some linting issues
This commit is contained in:
parent
6a67a77240
commit
ee7fb49e49
@ -232,14 +232,16 @@ def qmd5_hash(salt, data):
|
||||
log.debug('qmd5_hash() returning "%s"' % hash_value)
|
||||
return decode(hash_value.data(), 'ascii')
|
||||
|
||||
|
||||
def clean_button_text(button_text):
|
||||
"""
|
||||
Clean the & and other characters out of button text
|
||||
|
||||
|
||||
:param button_text: The text to clean
|
||||
"""
|
||||
return button_text.replace('&', '').replace('< ', '').replace(' >', '')
|
||||
|
||||
|
||||
from .openlpmixin import OpenLPMixin
|
||||
from .registry import Registry
|
||||
from .registrymixin import RegistryMixin
|
||||
|
@ -196,9 +196,10 @@ class TestCommonFunctions(TestCase):
|
||||
# GIVEN: Button text
|
||||
input_text = '&Next >'
|
||||
expected_text = 'Next'
|
||||
|
||||
|
||||
# WHEN: The button caption is sent through the clean_button_text function
|
||||
actual_text = clean_button_text(input_text)
|
||||
|
||||
|
||||
# THEN: The text should have been cleaned
|
||||
self.assertEqual(expected_text, actual_text, 'The text should be clean')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user