Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
4444ff39
Kaydet (Commit)
4444ff39
authored
Şub 04, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed direct manipulation of settings in auth tests; refs #21230.
üst
23c4cbc0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
test_auth_backends.py
django/contrib/auth/tests/test_auth_backends.py
+5
-4
test_remote_user.py
django/contrib/auth/tests/test_remote_user.py
+7
-8
No files found.
django/contrib/auth/tests/test_auth_backends.py
Dosyayı görüntüle @
4444ff39
from
__future__
import
unicode_literals
from
datetime
import
date
from
django.conf
import
settings
from
django.contrib.auth.backends
import
ModelBackend
from
django.contrib.auth.models
import
User
,
Group
,
Permission
,
AnonymousUser
from
django.contrib.auth.tests.utils
import
skipIfCustomUser
...
...
@@ -34,12 +33,14 @@ class BaseModelBackendTest(object):
backend
=
'django.contrib.auth.backends.ModelBackend'
def
setUp
(
self
):
self
.
curr_auth
=
list
(
settings
.
AUTHENTICATION_BACKENDS
)
settings
.
AUTHENTICATION_BACKENDS
=
[
self
.
backend
]
self
.
patched_settings
=
modify_settings
(
AUTHENTICATION_BACKENDS
=
{
'append'
:
self
.
backend
},
)
self
.
patched_settings
.
enable
()
self
.
create_users
()
def
tearDown
(
self
):
se
ttings
.
AUTHENTICATION_BACKENDS
=
self
.
curr_auth
se
lf
.
patched_settings
.
disable
()
# The custom_perms test messes with ContentTypes, which will
# be cached; flush the cache to ensure there are no side effects
# Refs #14975, #14925
...
...
django/contrib/auth/tests/test_remote_user.py
Dosyayı görüntüle @
4444ff39
...
...
@@ -6,7 +6,7 @@ from django.contrib.auth.backends import RemoteUserBackend
from
django.contrib.auth.middleware
import
RemoteUserMiddleware
from
django.contrib.auth.models
import
User
from
django.contrib.auth.tests.utils
import
skipIfCustomUser
from
django.test
import
TestCase
,
override_settings
from
django.test
import
TestCase
,
modify_settings
,
override_settings
from
django.utils
import
timezone
...
...
@@ -23,15 +23,14 @@ class RemoteUserTest(TestCase):
known_user2
=
'knownuser2'
def
setUp
(
self
):
self
.
curr_middleware
=
list
(
settings
.
MIDDLEWARE_CLASSES
)
self
.
curr_auth
=
list
(
settings
.
AUTHENTICATION_BACKENDS
)
settings
.
MIDDLEWARE_CLASSES
=
settings
.
MIDDLEWARE_CLASSES
+
[
self
.
middleware
]
settings
.
AUTHENTICATION_BACKENDS
=
settings
.
AUTHENTICATION_BACKENDS
+
[
self
.
backend
]
self
.
patched_settings
=
modify_settings
(
AUTHENTICATION_BACKENDS
=
{
'append'
:
self
.
backend
},
MIDDLEWARE_CLASSES
=
{
'append'
:
self
.
middleware
},
)
self
.
patched_settings
.
enable
()
def
tearDown
(
self
):
"""Restores settings to avoid breaking other tests."""
settings
.
MIDDLEWARE_CLASSES
=
self
.
curr_middleware
settings
.
AUTHENTICATION_BACKENDS
=
self
.
curr_auth
self
.
patched_settings
.
disable
()
def
test_no_remote_user
(
self
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment