forked from openlp/openlp
If invlaid bible name stop searching
Fixes: https://launchpad.net/bugs/1290246
This commit is contained in:
parent
22a4974d86
commit
f4ff654a65
@ -330,7 +330,10 @@ def parse_reference(reference, bible, language_selection, book_ref_id=False):
|
||||
if not book_ref_id:
|
||||
book_ref_id = bible.get_book_ref_id_by_localised_name(book, language_selection)
|
||||
elif not bible.get_book_by_book_ref_id(book_ref_id):
|
||||
book_ref_id = False
|
||||
return False
|
||||
# We have not found the book so do not continue
|
||||
if not book_ref_id:
|
||||
return False
|
||||
ranges = match.group('ranges')
|
||||
range_list = get_reference_match('range_separator').split(ranges)
|
||||
ref_list = []
|
||||
|
@ -105,3 +105,13 @@ class TestBibleManager(TestCase, TestMixin):
|
||||
# THEN a verse array should be returned
|
||||
self.assertEqual([(54, 1, 1, -1), (54, 2, 1, 1)], results,
|
||||
"The bible verses should match the expected results")
|
||||
|
||||
def parse_reference_four_test(self):
|
||||
"""
|
||||
Test the parse_reference method with non existence book
|
||||
"""
|
||||
# GIVEN given a bible in the bible manager
|
||||
# WHEN asking to parse the bible reference
|
||||
results = parse_reference('Raoul 1', self.manager.db_cache['tests'], MagicMock())
|
||||
# THEN a verse array should be returned
|
||||
self.assertEqual(False, results, "The bible Search should return False")
|
||||
|
Loading…
Reference in New Issue
Block a user