Now, go to the restful01 folder that contains the manage.py file, with the virtual environment activated, and run the following command:
pytest
The pytest command and the Django REST framework will perform the following actions:
- Create a clean test database name test_drones.
- Run all the migrations required for the database.
- Discover the tests that have to be executed based on the settings specified in the pytest.ini file.
- Run all the methods whose name starts with the test_ prefix in the DroneCategoryTests class and display the results. We declared this class in the tests.py file and it matches the pattern specified for the python_files setting in the pytest.ini file.
- Drop the test database ...