django_runtests-0.4.0
توضیحات
A base framework to write a simple runtests.py script for django apps.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | django_runtests-0.4.0 |
| نام | django_runtests |
| نسخه کتابخانه | 0.4.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Raphaël Barrois |
| ایمیل نویسنده | raphael.barrois@polytechnique.org |
| آدرس صفحه اصلی | http://github.com/rbarrois/django-runtests |
| آدرس اینترنتی | https://pypi.org/project/django_runtests/ |
| مجوز | MIT |
django-runtests
===============
Eases the writing of a ``runtests.py`` script for pluggable django application.
Such scripts usually provide a ``runtests()`` method that handle the test running behaviour.
Installation
------------
- Globally::
$ pip install django-runtests
- From the package's ``setup.py`` file (using Distribute)::
setup(
test_requires=[
'django-runtests',
],
test_suite='runtests.runtests',
)
Defining the test setup
-----------------------
In your ``runtests.py`` file, add the following code::
from django_runtests import RunTests
def runtests():
return RunTests.runtests()
if __name__ == '__main__':
RunTests.main()
Tweaking the test setup
-----------------------
If you need to tweak some parts (updating configuration, adding options, ...), you
simply have to extend the ``RunTests`` command class::
import django_runtests
class RunTests(django_runtests.RunTests):
def should_test_app(self, app):
"""Test only applications listed in 'PACKAGE_APPS' setting."""
from django.conf import settings
return app in settings.PACKAGE_APPS
.. vim:set ft=rst:
نحوه نصب
نصب پکیج whl django_runtests-0.4.0:
pip install django_runtests-0.4.0.whl
نصب پکیج tar.gz django_runtests-0.4.0:
pip install django_runtests-0.4.0.tar.gz