Skip to main content

HitchDjango

HitchDjango is a plugin for the Hitch test framework that lets you run and interact with Django as part of a test.

When the plugin starts Django, before running runserver, it will:

  • Check the version and fail if it is different to what is specified.

  • Run migrations (using manage.py migrate).

  • Get the URL using localhost + the specified port and put it in sites.site.

  • Install all specified Django fixtures.

Currently HitchDjango runs only on Django 1.8 and above. Please raise a ticket if you need an earlier version.

Use with Hitch

Install like so:

$ hitch install hitchdjango
# Service definition in engine's setUp:
self.services['Django'] = hitchdjango.DjangoService(
    version="1.8",                                              # Mandatory
    python="{}/venv/bin/python".format(PROJECT_DIRECTORY),      # Mandatory
    managepy=None,                                              # Optional full path to manage.py (default: None, assumes in project directory)
    django_fixtures=['fixture1.json',],                         # Optional (default: None)
    port=18080,                                                 # Optional (default: 18080)
    settings="remindme.settings",                               # Optional (default: settings)
    needs=[self.services['Postgres'], ]                         # Optional (default: no prerequisites)
)


# Interact during the test:
>>> self.services['Django'].manage("help").run()
[ Prints help ]

>>> self.services['Django'].url()
http://127.0.0.1:18080/

>>> self.services['Django'].savefixture("fixtures/database_current_state.json").run()
[ Saves fixture ]

See this service in action at the DjangoRemindMe project.

Metadata

Release files for hitchdjango 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hitchdjango 0.2
File Size Uploaded Provenance Actions
hitchdjango-0.2.tar.gz 4.0 kB Without provenance Details for hitchdjango-0.2.tar.gz

Release files / hitchdjango-0.2.tar.gz

Download URL hitchdjango-0.2.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
189d8cfa4f335d564840ea6c403dbb76c90c6e975c127c357586fd85ee34801b
BLAKE2b-256 checksum
How to use checksums
a0f8b44bac68aaf6d17c9df6d4a4b13ad9953695c47ff98071213c8f17c26148
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for hitchdjango 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page