diff options
author | Daniyal <abbasi.daniyal98@gmail.com> | 2021-03-16 21:11:27 +0530 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-19 08:04:37 +0100 |
commit | 474cc420bf6bc1067e2aaa4b40cf6a08d62096f7 (patch) | |
tree | 1281ae03beab376bbc08c0741da3b91d285cc2e3 /tests/file_storage | |
parent | 37044817f9a57126d655f216019e8c8cca7c151b (diff) | |
download | django-474cc420bf6bc1067e2aaa4b40cf6a08d62096f7.tar.gz |
Refs #32508 -- Raised Type/ValueError instead of using "assert" in django.core.
Diffstat (limited to 'tests/file_storage')
-rw-r--r-- | tests/file_storage/tests.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index 6d17a7118b..381bc6b7b5 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -501,7 +501,10 @@ class FileStorageTests(SimpleTestCase): Calling delete with an empty name should not try to remove the base storage directory, but fail loudly (#20660). """ - with self.assertRaises(AssertionError): + msg = 'The name must be given to delete().' + with self.assertRaisesMessage(ValueError, msg): + self.storage.delete(None) + with self.assertRaisesMessage(ValueError, msg): self.storage.delete('') def test_delete_deletes_directories(self): |