コード例 #1
0
 def test_success_backup_in_media_file_debug(self):
     self.storage = FileSystemStorage(location=settings.MEDIA_ROOT)
コード例 #2
0
 def test_success(self):
     self.storage = FileSystemStorage(location='foo')
コード例 #3
0
 def test_fail_backup_in_media_file(self):
     with self.assertRaises(ImproperlyConfigured):
         self.storage = FileSystemStorage(location=settings.MEDIA_ROOT)
コード例 #4
0
 def test_fail_no_location(self):
     with self.assertRaises(Exception):
         self.storage = FileSystemStorage()
コード例 #5
0
 def test_fail_location_is_empty_str(self):
     with self.assertRaises(Exception):
         self.storage = FileSystemStorage(location='')
コード例 #6
0
 def test_fail_location_is_none(self):
     with self.assertRaises(Exception):
         self.storage = FileSystemStorage(location=None)
コード例 #7
0
 def setUp(self):
     self.temp_dir = tempfile.mkdtemp()
     self.storage = FileSystemStorage(location=self.temp_dir)