mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-10-22 19:54:50 +03:00
Added some important notes on contributing.md
This commit is contained in:
parent
7e8962c622
commit
edaf07b45d
|
@ -81,6 +81,23 @@ To run the tests, clone the repository, and then:
|
||||||
# Run the tests
|
# Run the tests
|
||||||
./runtests.py
|
./runtests.py
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
If your tests require access to the database, do not forget to inherit from `django.test.TestCase`.
|
||||||
|
For example:
|
||||||
|
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
class MyDatabaseTest(TestCase):
|
||||||
|
def test_something(self):
|
||||||
|
# Your test code here
|
||||||
|
pass
|
||||||
|
|
||||||
|
You can reuse existing models defined in `tests/models.py` for your tests.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### Test options
|
### Test options
|
||||||
|
|
||||||
Run using a more concise output style.
|
Run using a more concise output style.
|
||||||
|
@ -99,6 +116,10 @@ Shorter form to run the tests for a given test method.
|
||||||
|
|
||||||
./runtests.py test_this_method
|
./runtests.py test_this_method
|
||||||
|
|
||||||
|
**Note:** If you do not want the output to be captured (for example, to see print statements directly), you can use the `-s` flag:
|
||||||
|
|
||||||
|
./runtests.py -s
|
||||||
|
|
||||||
Note: The test case and test method matching is fuzzy and will sometimes run other tests that contain a partial string match to the given command line input.
|
Note: The test case and test method matching is fuzzy and will sometimes run other tests that contain a partial string match to the given command line input.
|
||||||
|
|
||||||
### Running against multiple environments
|
### Running against multiple environments
|
||||||
|
|
Loading…
Reference in New Issue
Block a user