skip to navigation
skip to content

django-plainpasswordhasher 0.3

Dummy (plain text) password hashing for Django.

Dummy (plain text) password hashing for Django… for use in tests!

Speed up tests!

Cryptography is greedy. When you run tests, you usually do not care about password security, but you care about performances. Using dummy password hashing speeds up tests!

Install django-plainpasswordhasher with your favorite installer. Here is an example using pip:

pip install django-plainpasswordhasher

Then configure your test settings:

PASSWORD_HASHERS = ('django_plainpasswordhasher.PlainPasswordHasher', )

Except explicit password hashing tests

In most cases, using a dummy password hasher will do the job. But you may write some tests that require real password hashing. In such a case, let’s override settings!

from django.conf import global_settings  # Django default settings...
                                         # You may use your project's
                                         # default settings instead.
from django.test import TestCase
from django.test.utils import override_settings

class CryptographyTestCase(TestCase):
     """Tests that require real cryptography."""
File Type Py Version Uploaded on Size (md5) Source 2013-10-14 10KB
  • Downloads (All Versions):
  • 3 downloads in the last day
  • 689 downloads in the last week
  • 1786 downloads in the last month