Skip to main content

rustest-django

Docs

Django integration for rustest: a port of pytest-django exposed as a rustest fixture module.

Goal: existing pytest-django test suites run under rustest with only an import-path swap.

Status

The v1 supported tier is implemented and CI-verified: configuration resolution, the DB isolation engine, the fixture-module entry point, T1 core and selected T2 fixtures (client/rf, admin_*, settings, mailoutbox, query-assertion helpers, DB lifecycle fixtures), the unittest-style and unsupported-feature guards, rustest_django.asserts, and the rustest_django.django_db class decorator. The first release, 0.0.1, is published on PyPI. "v1" names the implementation scope; the package uses independent pre-1.0 versions.

The full design is written up in docs/spec.md, which links out to a section per topic (configuration, DB isolation, the public API, async support, testing and CI), with completed follow-ups and remaining work. Published-package docs: https://rustest-django.readthedocs.io/en/stable/. Unreleased main docs: https://rustest-django.readthedocs.io/en/latest/.

The current source also implements live server, serialized rollback and app-registry isolation, URL/template markers, django-configurations, and database suffixes. Project options support native TOML, compatible pytest TOML, and INI fallbacks. See Configuration and the remaining runner boundaries. These additions are unreleased; stable documents the published package.

Using it

# pyproject.toml
[project]
dependencies = ["rustest-django"]
# conftest.py
rustest_fixtures = ["rustest_django"]

That's the whole integration surface. Within the supported tier, an existing pytest-django test suite runs by swapping pytest_django imports for rustest_django (see docs/spec/api.md) and running rustest with --pytest-compat if any test files still import pytest directly.

Agent skills

Two agent skills help a coding agent work with rustest-django in your project:

Install both with skills.sh, which supports Claude Code and other agents:

npx skills add ernestomancebo/rustest-django

The agent loads a skill when your request matches its description, so ask for the task, for example "migrate these tests to rustest-django".

Example projects

examples/ has three self-contained Django projects proving the name-swap claim for real, unmodified pytest-django test files:

  • minimal-sqlite: T1 core end to end.
  • multi-db: the databases= marker kwarg and cross-database isolation.
  • async-views: async_client/async_rf and DB access from async tests.

Each one runs its tests/ directory under both real pytest and rustest --pytest-compat, and examples/compare_outcomes.py diffs the two outcome sets exactly. CI runs this across every supported Python/Django/DB combination (see .github/workflows/ci.yml).

Development

uv sync
uv run pre-commit install

See the Makefile for the common commands (make lint, make test, make build, make parity-test).

Attribution

This project is a port of pytest-django, copyright (c) pytest-django contributors, licensed under the BSD 3-Clause License. See LICENSE.

Metadata

Release files for rustest-django 0.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 rustest-django 0.0.2
File Size Uploaded Provenance
rustest_django-0.0.2.tar.gz 241.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rustest-django 0.0.2
File Interpreter ABI Platform
rustest_django-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 269.0 kB

Release files / rustest_django-0.0.2.tar.gz

Download URL rustest_django-0.0.2.tar.gz
Size 241.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c74b73c2e5a14f76cec642d9142af0886dcdcdf8e479f6bf3d6268c80fc2ad95
BLAKE2b-256 checksum
How to use checksums
6bc453dbd3b400e32d7de1d97652d416b49dbf9859b717023374f6aefe2534f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / rustest_django-0.0.2-py3-none-any.whl

Download URL rustest_django-0.0.2-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
faf7f917d9737bde7f876bd9a6cce5f9f0416c71c0b0fd44756f601f8022e30e
BLAKE2b-256 checksum
How to use checksums
b866e5ec433bf23b6aa7c5ab07ffa8adafc9cc92542edacd76d411fd3c4ec5b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for rustest-django 0.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rustest_django-0.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

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.

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