mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-19 10:19:27 -05:00
Add some failing edge case tests
This commit is contained in:
parent
8afdcabca8
commit
a22f088e28
@ -92,6 +92,38 @@ class TestAttachment(TestCase):
|
|||||||
self.TAGS
|
self.TAGS
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_guess_attributes_from_name_when_correspondent_empty(self):
|
||||||
|
self._test_guess_attributes_from_name(
|
||||||
|
'/path/to/ - weird empty correspondent but should not break.{}',
|
||||||
|
None,
|
||||||
|
' - weird empty correspondent but should not break',
|
||||||
|
()
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_guess_attributes_from_name_when_title_starts_with_dash(self):
|
||||||
|
self._test_guess_attributes_from_name(
|
||||||
|
'/path/to/- weird but should not break.{}',
|
||||||
|
None,
|
||||||
|
'- weird but should not break',
|
||||||
|
()
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_guess_attributes_from_name_when_title_ends_with_dash(self):
|
||||||
|
self._test_guess_attributes_from_name(
|
||||||
|
'/path/to/weird but should not break -.{}',
|
||||||
|
None,
|
||||||
|
'weird but should not break -',
|
||||||
|
()
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_guess_attributes_from_name_when_title_is_empty(self):
|
||||||
|
self._test_guess_attributes_from_name(
|
||||||
|
'/path/to/weird correspondent but should not break - .{}',
|
||||||
|
'weird correspondent but should not break',
|
||||||
|
'',
|
||||||
|
()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Permutations(TestCase):
|
class Permutations(TestCase):
|
||||||
valid_correspondents = ['timmy', 'Dr. McWheelie',
|
valid_correspondents = ['timmy', 'Dr. McWheelie',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user