﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21248	Password tests failure on Django 1.5 (bcrypt related)	Anssi Kääriäinen	nobody	"I get this failure when running Django's test suite on stable/1.5.x (at commit f8393edb52e3dc73185f2496bfa08463fa4ffa09):
{{{
======================================================================
ERROR: test_bcrypt (django.contrib.auth.tests.hashers.TestUtilsHashPass)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/home/akaariai/Programming/py27_venv/local/lib/python2.7/site-packages/django/contrib/auth/tests/hashers.py"", line 100, in test_bcrypt
    self.assertTrue(check_password('lètmein', encoded))
  File ""/home/akaariai/Programming/py27_venv/local/lib/python2.7/site-packages/django/contrib/auth/hashers.py"", line 55, in check_password
    is_correct = hasher.verify(password, encoded)
  File ""/home/akaariai/Programming/py27_venv/local/lib/python2.7/site-packages/django/contrib/auth/hashers.py"", line 293, in verify
    return constant_time_compare(data, bcrypt.hashpw(force_bytes(password), data))
  File ""/home/akaariai/Programming/py27_venv/local/lib/python2.7/site-packages/bcrypt/__init__.py"", line 91, in hashpw
    raise TypeError(""Unicode-objects must be encoded before hashing"")
TypeError: Unicode-objects must be encoded before hashing
}}}

The failure happens only when bcrypt is installed. Tested bcrypt 1.0.0-1.0.2. The failure happens both on Python 2.7 and 3.2. It seems the error is there in first 1.5 release, too. The error isn't present in 1.6.x."	Bug	closed	contrib.auth	1.5	Normal	fixed			Unreviewed	0	0	0	0	0	0
