Skip to content

Commit 52789e7

Browse files
committed
Add test about None filename issue in search and replace
1 parent 9028631 commit 52789e7

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGES.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Changelog
66

77
- Python 3, Plone 5.2 and Plone 6.0 compatible.
88
[aduchene]
9-
9+
- Fixed an issue when odt_file.filename could be None when searching and replacing.
10+
[aduchene]
1011

1112
3.43 (2024-04-10)
1213
-----------------

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
'z3c.table',
5454
# fix about orderedselect
5555
'z3c.form>=3.2.4',
56-
'imio.helpers>=0.57',
56+
'imio.helpers>=1.0',
5757
'imio.migrator>=1.11'
5858
],
5959
extras_require={

src/collective/documentgenerator/tests/test_search_replace.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,11 @@ def test_search_replace_control_panel_regex_validator(self):
417417
data = {"replacements": replacements}
418418
errors = form.widgets.validate(data)
419419
self.assertFalse(errors)
420+
421+
def test_no_odt_file_or_no_filename(self):
422+
self.template1.odt_file = None
423+
self.template2.odt_file.filename = None
424+
with SearchAndReplacePODTemplates((self.template1, self.template2)) as search_replace:
425+
results = search_replace.search("view")
426+
427+
self.assertEqual(len(results.keys()), 0)

0 commit comments

Comments
 (0)