Shared Test Factory Package for all Platform Django repos
Project description
iil-testkit
Shared Test Factory Package for all Platform Django repos — ADR-100
Installation
pip install iil-testkit
Or in requirements-test.txt:
iil-testkit>=0.1.0
Usage
Factories
# tests/factories.py — import shared, extend repo-specific
from iil_testkit.factories import UserFactory
import factory
class BookProjectFactory(factory.django.DjangoModelFactory):
class Meta:
model = "bfagent.BookProjects"
user = factory.SubFactory(UserFactory)
title = factory.Sequence(lambda n: f"Book {n}")
Fixtures
def test_should_view_dashboard(auth_client):
response = auth_client.get("/dashboard/")
assert response.status_code == 200
Available fixtures: db_user, staff_user, admin_user, api_client, auth_client, staff_client
Assertion Helpers
from iil_testkit.assertions import assert_redirects_to_login, assert_htmx_response
def test_should_redirect_unauthenticated(api_client):
response = api_client.get("/protected/")
assert_redirects_to_login(response)
Naming Convention (ADR-057)
Auto-registered pytest plugin warns when test functions don't follow test_should_*:
PytestWarning: Naming convention: 'test_login' should start with 'test_should_'
Suppress with: pytest --no-naming-check
Architecture
See ADR-100.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iil_testkit-0.1.0.tar.gz.
File metadata
- Download URL: iil_testkit-0.1.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b55f43eb68ca5d67528100b2f1bf7d43ef4432cd630660915b67aec64d1b2fd
|
|
| MD5 |
e016cd038b7fa7d76733a79315d7de09
|
|
| BLAKE2b-256 |
96ca3a46d0eb9ce8c73b280cbeacc19e4d4e0e0bd6d6b8a1c2a2f0e47f350beb
|
Provenance
The following attestation bundles were made for iil_testkit-0.1.0.tar.gz:
Publisher:
publish.yml on achimdehnert/testkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iil_testkit-0.1.0.tar.gz -
Subject digest:
8b55f43eb68ca5d67528100b2f1bf7d43ef4432cd630660915b67aec64d1b2fd - Sigstore transparency entry: 1053037053
- Sigstore integration time:
-
Permalink:
achimdehnert/testkit@b41a3d629a964e96b5f1eb0348c8618a3c90f56d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/achimdehnert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b41a3d629a964e96b5f1eb0348c8618a3c90f56d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file iil_testkit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iil_testkit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e83c4d8526e053a31cef83947134a5d06d3f483cd6b2b3d9406afd308403e0f1
|
|
| MD5 |
4d5f964d803ef7e322d609a2af3dfa7e
|
|
| BLAKE2b-256 |
023b23535531a8704cee90e864386cb5a64a99aa31f2ead040cf85bea332770b
|
Provenance
The following attestation bundles were made for iil_testkit-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on achimdehnert/testkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iil_testkit-0.1.0-py3-none-any.whl -
Subject digest:
e83c4d8526e053a31cef83947134a5d06d3f483cd6b2b3d9406afd308403e0f1 - Sigstore transparency entry: 1053037114
- Sigstore integration time:
-
Permalink:
achimdehnert/testkit@b41a3d629a964e96b5f1eb0348c8618a3c90f56d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/achimdehnert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b41a3d629a964e96b5f1eb0348c8618a3c90f56d -
Trigger Event:
workflow_dispatch
-
Statement type: