2016-11-08 03:12:25 +01:00
|
|
|
======================
|
|
|
|
Running the Test Suite
|
|
|
|
======================
|
2009-08-19 21:59:46 +02:00
|
|
|
|
2013-02-19 02:07:28 +01:00
|
|
|
The easiest way to run the django-filter tests is to check out the source
|
2016-11-08 17:16:08 +01:00
|
|
|
code and create a virtualenv where you can install the test dependencies.
|
|
|
|
Django-filter uses a custom test runner to configure the environment, so a
|
2013-02-19 02:07:28 +01:00
|
|
|
wrapper script is available to set up and run the test suite.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
The following assumes you have `virtualenv`__ and `git`__ installed.
|
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
__ https://virtualenv.pypa.io/en/stable/
|
|
|
|
__ https://git-scm.com
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
Clone the repository
|
|
|
|
--------------------
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
Get the source code using the following command:
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-09-04 06:14:06 +02:00
|
|
|
.. code-block:: bash
|
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
$ git clone https://github.com/carltongibson/django-filter.git
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
Switch to the django-filter directory:
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-09-04 06:14:06 +02:00
|
|
|
.. code-block:: bash
|
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
$ cd django-filter
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
Set up the virtualenv
|
|
|
|
---------------------
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
Create a new virtualenv to run the test suite in:
|
2016-09-04 06:14:06 +02:00
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
.. code-block:: bash
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
$ virtualenv venv
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
Then activate the virtualenv and install the test requirements:
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-09-04 06:14:06 +02:00
|
|
|
.. code-block:: bash
|
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
$ source venv/bin/activate
|
|
|
|
$ pip install -r requirements/test.txt
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
Execute the test runner
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
Run the tests with the runner script:
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2016-09-04 06:14:06 +02:00
|
|
|
.. code-block:: bash
|
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
$ python runtests.py
|
2013-02-19 02:07:28 +01:00
|
|
|
|
2015-07-18 21:47:20 +02:00
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
Test all supported versions
|
|
|
|
---------------------------
|
2015-07-18 21:47:20 +02:00
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
You can also use the excellent tox testing tool to run the tests against all
|
|
|
|
supported versions of Python and Django. Install tox, and then simply run:
|
2015-07-18 21:47:20 +02:00
|
|
|
|
2016-09-04 06:14:06 +02:00
|
|
|
.. code-block:: bash
|
|
|
|
|
2016-11-08 17:16:08 +01:00
|
|
|
$ pip install tox
|
|
|
|
$ tox
|