Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Expand testing of Test LiveServerTestCase static files serving.

  • Loading branch information...
commit 22af1394c64b6687e45747ae9f643068b340a867 1 parent cb92e33
Ramiro Morales ramiro authored
1  tests/runtests.py
View
@@ -60,6 +60,7 @@ def upath(path):
'staticfiles_tests',
'staticfiles_tests.apps.test',
'staticfiles_tests.apps.no_label',
+ 'servers.another_app',
]
0  tests/servers/another_app/__init__.py
View
No changes.
0  tests/servers/another_app/models.py
View
No changes.
1  tests/servers/another_app/static/another_app/another_app_static_file.txt
View
@@ -0,0 +1 @@
+static file from another_app
8 tests/servers/tests.py
View
@@ -145,6 +145,14 @@ def test_static_files(self):
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.
Please sign in to comment.
Something went wrong with that request. Please try again.