コード例 #1
0
ファイル: test_finders.py プロジェクト: Birama0810/Django
 def test_location_empty(self):
     msg = (
         "The storage backend of the staticfiles finder "
         "<class 'django.contrib.staticfiles.finders.DefaultStorageFinder'> "
         "doesn't have a valid location.")
     with self.assertRaisesMessage(ImproperlyConfigured, msg):
         finders.DefaultStorageFinder()
コード例 #2
0
 def setUp(self):
     super(TestDefaultStorageFinder, self).setUp()
     self.finder = finders.DefaultStorageFinder(
         storage=storage.StaticFilesStorage(location=settings.MEDIA_ROOT))
     test_file_path = os.path.join(settings.MEDIA_ROOT, 'media-file.txt')
     self.find_first = ('media-file.txt', test_file_path)
     self.find_all = ('media-file.txt', [test_file_path])
コード例 #3
0
 def test_location_empty(self):
     with self.assertRaises(ImproperlyConfigured):
         finders.DefaultStorageFinder()