﻿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
20796	AUTHENTICATION_BACKENDS RemoteUserBackend breaks tests	python_monster	nobody	"After creating a new django (1, 5, 1, 'final', 0) project, configuring RemoteUser functionality breaks tests:

== settings.py ==

{{{
DATABASES['default']['ENGINE'] = 'django.db.backends.sqlite3'
DATABASES['default']['NAME'] = 'proj.db'
MIDDLEWARE_CLASSES += (
'django.contrib.auth.middleware.RemoteUserMiddleware',)
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.RemoteUserBackend',
'django.contrib.auth.backends.ModelBackend',
)
}}}

== python manage.py test auth.RemoteUserCustomTest ==

{{{
Creating test database for alias 'default'...
FFF.F
======================================================================
FAIL: test_header_disappears (django.contrib.auth.tests.remote_user.RemoteUserCustomTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/opt/virtualenv/proj/lib/python2.7/site-packages/django/contrib/auth/tests/remote_user.py"", line 109, in test_header_disappears
    self.assertEqual(response.context['user'].username, 'knownuser')
AssertionError: 'knownuser@example.com' != 'knownuser'

======================================================================
FAIL: test_known_user (django.contrib.auth.tests.remote_user.RemoteUserCustomTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/opt/virtualenv/proj/lib/python2.7/site-packages/django/contrib/auth/tests/remote_user.py"", line 188, in test_known_user
    super(RemoteUserCustomTest, self).test_known_user()
  File ""/opt/virtualenv/proj/lib/python2.7/site-packages/django/contrib/auth/tests/remote_user.py"", line 71, in test_known_user
    self.assertEqual(response.context['user'].username, 'knownuser')
AssertionError: 'knownuser@example.com' != 'knownuser'

======================================================================
FAIL: test_last_login (django.contrib.auth.tests.remote_user.RemoteUserCustomTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/opt/virtualenv/proj/lib/python2.7/site-packages/django/contrib/auth/tests/remote_user.py"", line 99, in test_last_login
    self.assertEqual(default_login, response.context['user'].last_login)
AssertionError: datetime.datetime(2000, 1, 1, 0, 0, tzinfo=<UTC>) != datetime.datetime(2013, 7, 24, 8, 2, 15, 485797, tzinfo=<UTC>)

======================================================================
FAIL: test_unknown_user (django.contrib.auth.tests.remote_user.RemoteUserCustomTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/opt/virtualenv/proj/lib/python2.7/site-packages/django/contrib/auth/tests/remote_user.py"", line 198, in test_unknown_user
    self.assertEqual(newuser.email, 'user@example.com')
AssertionError: u'' != 'user@example.com'

----------------------------------------------------------------------
Ran 5 tests in 0.071s

FAILED (failures=4)
Destroying test database for alias 'default'...

}}}

== python manage.py test auth.RemoteUserNoCreateTest ==

{{{
Creating test database for alias 'default'...
....F
======================================================================
FAIL: test_unknown_user (django.contrib.auth.tests.remote_user.RemoteUserNoCreateTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/opt/virtualenv/proj/lib/python2.7/site-packages/django/contrib/auth/tests/remote_user.py"", line 145, in test_unknown_user
    self.assertTrue(response.context['user'].is_anonymous())
AssertionError: False is not true

----------------------------------------------------------------------
Ran 5 tests in 0.440s

FAILED (failures=1)
Destroying test database for alias 'default'...
}}}"	Bug	closed	contrib.auth	1.5	Normal	duplicate		timograham@…	Unreviewed	0	0	0	0	0	0
