A Django Toolkit for controlling Query count when testing. It controls the number of queries done in the tests stays below a particular threshold between Test Runs.Specially useful when paired with a CI like Jenkins or Travis to control each commit doesn’t slow down the Database considerably.
- This is a custom test runner for Django that gives you.really. colorful test output.
- Django Best Practices: Custom User Model. By Will Vincent; Dec 7, 2020; Django ships with a built-in User model for authentication and if you'd like a basic tutorial on how to implement log in, log out, sign up and so on see the Django Login and Logout tutorial for more.
The easiest way to run the django-filter tests is to check out the sourcecode and create a virtualenv where you can install the test dependencies.Django-filter uses a custom test runner to configure the environment, so awrapper script is available to set up and run the test suite.
Note
The following assumes you have virtualenv and git installed.
Clone the repository¶
Get the source code using the following command:
Switch to the django-filter directory:
Set up the virtualenv¶
Create a new virtualenv to run the test suite in:
Then activate the virtualenv and install the test requirements:
Execute the test runner¶
Run the tests with the runner script:
Django Unit Test
Test all supported versions¶
You can also use the excellent tox testing tool to run the tests against allsupported versions of Python and Django. Install tox, and then simply run:
Housekeeping¶
The isort
utility is used to maintain module imports. You can either testthe module imports with the appropriate tox env, or with isort directly.
To sort the imports, simply remove the --check-only
option.
#26981closedNew feature (fixed)
Reported by: | Owned by: | ||
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Change History (6)
comment:1 Changed 5 years ago by
comment:2 Changed 5 years ago by
Owner: | changed from nobody to Chris Jerdonek |
---|---|
Status: | new → assigned |
Version: | 1.9 → master |
comment:3 Changed 5 years ago by
comment:4 Changed 5 years ago by
Django Run
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → New feature |