Package: django-smoke-tests
Django command that finds all endpoints in project, executes HTTP requests against them and checks if there are any unexpected responses.ContentsRequirementsInstallationQuickstartUsageParametersSkipping testsReporting bugsContributingCreditsRequirementsPython (3.7, 3.8, 3.9, 3.10)Django (2.2 LTS, 3.2 LTS)InstallationInstall using pip:pip install django-smoke-testsAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_smoke_tests',...)QuickstartExecute smoke tests for the whole project:python manage.py smoke_testsUsageParameters$ python manage.py smoke_tests --help
usage: manage.py smoke_tests [-h] [--http-methods HTTP_METHODS]
                             [--allow-status-codes ALLOW_STATUS_CODES]
                             [--disallow-status-codes DISALLOW_STATUS_CODES]
                             [--settings SETTINGS]
                             [--configuration CONFIGURATION]
                             [--fixture FIXTURE] [--no-migrations] [--no-db]
                             [app_names]

Smoke tests for Django endpoints.

positional arguments:
  app_names             names of apps to test

optional arguments:
  -h, --help            show this help message and exit
  --http-methods HTTP_METHODS
                        comma separated HTTP methods that will be executed for
                        all endpoints, eg. GET,POST,DELETE
                        [default: GET,POST,PUT,DELETE]
  -g, --get-only        shortcut for --http-methods GET
  --allow-status-codes ALLOW_STATUS_CODES
                        comma separated HTTP status codes that will be
                        considered as success responses, eg. 200,201,204;
                        404 is allowed by default for detail URLs (paths with parameters)
                        [default: 200,201,301,302,304,405]
  --disallow-status-codes DISALLOW_STATUS_CODES
                        comma separated HTTP status codes that will be
                        considered as fail responses, eg. 404,500
  --settings SETTINGS   path to the Django settings module, eg.
                        myproject.settings
  --configuration CONFIGURATION
                        name of the configuration class to load, eg.
                        Development
  --fixture FIXTURE     Django fixture JSON file to be loaded before executing
                        smoke tests
  --no-migrations       flag for skipping migrations, database will be created
                        directly from models
  --no-db               flag for skipping database creationSkipping testsTo skip tests for specific URLs addSKIP_SMOKE_TESTSoption in your settings.This setting should contain list of URL pattern names.SKIP_SMOKE_TESTS=('all-astronauts',# to skip url(r'^astronauts/', AllAstronauts.as_view(), name='all-astronauts')'missions:all-launches',# to skip 'all-launches' from 'missions' app)Reporting bugsIf you face any problems please report them to the issue tracker athttps://github.com/kamilkijak/django-smoke-tests/issuesContributingRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackage