Commit 22af1394 authored by Ramiro Morales's avatar Ramiro Morales
Browse files

Expand testing of Test LiveServerTestCase static files serving.

parent cb92e339
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ ALWAYS_INSTALLED_APPS = [
    'staticfiles_tests',
    'staticfiles_tests.apps.test',
    'staticfiles_tests.apps.no_label',
    'servers.another_app',
]


+0 −0

Empty file added.

+0 −0

Empty file added.

+1 −0
Original line number Diff line number Diff line
static file from another_app
+8 −0
Original line number Diff line number Diff line
@@ -145,6 +145,14 @@ class LiveServerViews(LiveServerBase):
        f = self.urlopen('/static/example_static_file.txt')
        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):
        """
        Ensure that the LiveServerTestCase serves media files.