Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Django Test Helper
==================

Django Test Helper provides some utility functions when testing Django applications

Installation
------------

Run `pip install django-test-helper`

Helpers
-------

###authenticated_client
A context that provides a Django test Client instance with an authenticated user. It takes a username and a password as arguments.

```python
from django.test import TestCase
from test_helper.utils import authenticated_user
from django.core.urlresolvers import reverse

class MyTest(TestCase):
def test_protected_view(self):
with autenticated_user('username', 'pass') as client:
response = client.get(reverse('protected_view')
self.assertEqual(response.status, 200)
```

###image_file
Creates on-the-fly an image and returns it. It takes a size tuple and a color rgb tuple.

```python
from django.test import TestCase
from test_helper.utils import image_file

class MyTest(TestCase):
def test_form(self):
data = {
'first_name': 'John',
'last_name': 'Smith',
}
image = image_file(size=(100, 100),
color=(128, 128, 128))
files = {
'avatar': image,
}
form = ProfileForm(data, files)
self.assertTrue(form.is_valid())
```

Metadata

Release files for django-test-helper 0.1a2

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

Source distribution (sdist)

Source distribution for django-test-helper 0.1a2
File Size Uploaded Provenance
django-test-helper-0.1a2.zip 6.8 kB Without provenance Details

Release files / django-test-helper-0.1a2.zip

Download URL django-test-helper-0.1a2.zip
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cf2426d3cc47d66ade4a8f514170b4b95cf3eb00a358dba04a63b97428ae9e7e
BLAKE2b-256 checksum
How to use checksums
a80bc7ed2db7ff109ed51fe35b486891933d386930cba22f49dda4e1c2f9521d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-test-helper 0.1a2

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.

Release history Release notifications | RSS feed

This release
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