def test_success_backup_in_media_file_debug(self): self.storage = FileSystemStorage(location=settings.MEDIA_ROOT)
def test_success(self): self.storage = FileSystemStorage(location='foo')
def test_fail_backup_in_media_file(self): with self.assertRaises(ImproperlyConfigured): self.storage = FileSystemStorage(location=settings.MEDIA_ROOT)
def test_fail_no_location(self): with self.assertRaises(Exception): self.storage = FileSystemStorage()
def test_fail_location_is_empty_str(self): with self.assertRaises(Exception): self.storage = FileSystemStorage(location='')
def test_fail_location_is_none(self): with self.assertRaises(Exception): self.storage = FileSystemStorage(location=None)
def setUp(self): self.temp_dir = tempfile.mkdtemp() self.storage = FileSystemStorage(location=self.temp_dir)