diff options
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/staticfiles.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt index b9963414f4..8f5c1b25d1 100644 --- a/docs/ref/contrib/staticfiles.txt +++ b/docs/ref/contrib/staticfiles.txt @@ -406,3 +406,26 @@ files in app directories. That's because this view is **grossly inefficient** and probably **insecure**. This is only intended for local development, and should **never be used in production**. + +Specialized test case to support 'live testing' +----------------------------------------------- + +.. class:: testing.StaticLiveServerCase + +This unittest TestCase subclass extends :class:`django.test.LiveServerTestCase`. + +Just like its parent, you can use it to write tests that involve running the +code under test and consuming it with testing tools through HTTP (e.g. Selenium, +PhantomJS, etc.), because of which it's needed that the static assets are also +published. + +But given the fact that it makes use of the +:func:`django.contrib.staticfiles.views.serve` view described above, it can +transparently overlay at test execution-time the assets provided by the +``staticfiles`` finders. This means you don't need to run +:djadmin:`collectstatic` before or as a part of your tests setup. + +.. versionadded:: 1.7 + + ``StaticLiveServerCase`` is new in Django 1.7. Previously its functionality + was provided by :class:`django.test.LiveServerTestCase`. |
