2013-10-21 13:06:19 +00:00
|
|
|
###########
|
|
|
|
|
Write tests
|
|
|
|
|
###########
|
2013-03-20 15:46:24 +00:00
|
|
|
|
2013-10-28 15:58:18 +00:00
|
|
|
`django_downloadview` embeds test utilities:
|
2013-03-20 15:46:24 +00:00
|
|
|
|
2013-10-28 15:58:18 +00:00
|
|
|
* :func:`~django_downloadview.test.assert_download_response`
|
|
|
|
|
* :func:`~django_downloadview.test.temporary_media_root`
|
|
|
|
|
* :func:`~django_downloadview.nginx.tests.assert_x_accel_redirect`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
************************
|
|
|
|
|
assert_download_response
|
|
|
|
|
************************
|
|
|
|
|
|
|
|
|
|
.. autofunction:: django_downloadview.test.assert_download_response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
********************
|
|
|
|
|
temporary_media_root
|
|
|
|
|
********************
|
|
|
|
|
|
|
|
|
|
.. autofunction:: django_downloadview.test.temporary_media_root
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*******
|
|
|
|
|
Example
|
|
|
|
|
*******
|
|
|
|
|
|
|
|
|
|
Here are the tests related to :doc:`StorageDownloadView demo </views/storage>`:
|
|
|
|
|
|
|
|
|
|
.. literalinclude:: /../demo/demoproject/storage/tests.py
|
|
|
|
|
:language: python
|