#20796: AUTHENTICATION_BACKENDS RemoteUserBackend breaks tests
--------------------------------+--------------------
Reporter: python_monster | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: 1.5
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------
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: '[email protected]' != '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: '[email protected]' != '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, '[email protected]')
AssertionError: u'' != '[email protected]'
----------------------------------------------------------------------
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'...
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20796>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/057.5ae730cde8faa8a44753b75fad8c2701%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.