1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Refs #32508 -- Raised Type/ValueError instead of using "assert" in django.core.

This commit is contained in:
Daniyal
2021-03-16 21:11:27 +05:30
committed by Mariusz Felisiak
parent 37044817f9
commit 474cc420bf
8 changed files with 76 additions and 11 deletions

View File

@@ -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):