Expand testing of Test LiveServerTestCase static files serving.

This commit is contained in:
Ramiro Morales 2013-08-10 16:32:07 -03:00
parent cb92e3391b
commit 22af1394c6
5 changed files with 10 additions and 0 deletions

View File

@ -60,6 +60,7 @@ ALWAYS_INSTALLED_APPS = [
'staticfiles_tests', 'staticfiles_tests',
'staticfiles_tests.apps.test', 'staticfiles_tests.apps.test',
'staticfiles_tests.apps.no_label', 'staticfiles_tests.apps.no_label',
'servers.another_app',
] ]

View File

View File

View File

@ -0,0 +1 @@
static file from another_app

View File

@ -145,6 +145,14 @@ class LiveServerViews(LiveServerBase):
f = self.urlopen('/static/example_static_file.txt') f = self.urlopen('/static/example_static_file.txt')
self.assertEqual(f.read().rstrip(b'\r\n'), b'example static file') self.assertEqual(f.read().rstrip(b'\r\n'), b'example static file')
def test_collectstatic_emulation(self):
"""
Test LiveServerTestCase use of staticfiles' serve() allows it to
discover app's static assets without having to collectstatic first.
"""
f = self.urlopen('/static/another_app/another_app_static_file.txt')
self.assertEqual(f.read().rstrip(b'\r\n'), b'static file from another_app')
def test_media_files(self): def test_media_files(self):
""" """
Ensure that the LiveServerTestCase serves media files. Ensure that the LiveServerTestCase serves media files.