summaryrefslogtreecommitdiff
path: root/tests/forms_tests/field_tests/test_filepathfield.py
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2019-10-28 23:11:04 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-10-29 08:39:56 +0100
commit6c6d24a4feb632fc07d35c2ce23bb00f6ea9215c (patch)
tree1b26526b2f5a787f4cc2bef0ce4e38b974881004 /tests/forms_tests/field_tests/test_filepathfield.py
parentab0fd3f58f751859cc7c5260decf0acca26513bf (diff)
Refs #30908 -- Added test for nonexistent path in forms.FilePathField.
Diffstat (limited to 'tests/forms_tests/field_tests/test_filepathfield.py')
-rw-r--r--tests/forms_tests/field_tests/test_filepathfield.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/forms_tests/field_tests/test_filepathfield.py b/tests/forms_tests/field_tests/test_filepathfield.py
index 44f6aff521..2b9683ed84 100644
--- a/tests/forms_tests/field_tests/test_filepathfield.py
+++ b/tests/forms_tests/field_tests/test_filepathfield.py
@@ -41,6 +41,10 @@ class FilePathFieldTest(SimpleTestCase):
def test_fix_os_paths(self):
self.assertEqual(fix_os_paths(self.path), ('/filepathfield_test_dir/'))
+ def test_nonexistent_path(self):
+ with self.assertRaisesMessage(FileNotFoundError, 'nonexistent'):
+ FilePathField(path='nonexistent')
+
def test_no_options(self):
f = FilePathField(path=self.path)
expected = [