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
5e74d6cf
Kaydet (Commit)
5e74d6cf
authored
Nis 05, 2014
tarafından
Alejandro Gómez
Kaydeden (comit)
Tim Graham
Nis 07, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[1.7.x] Fixed #21084 -- Used proxy model's content type for admin log entries.
Backport of
7a7f6fcc
from master
üst
38679254
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
1 deletion
+33
-1
tests.py
tests/admin_views/tests.py
+33
-1
No files found.
tests/admin_views/tests.py
Dosyayı görüntüle @
5e74d6cf
...
...
@@ -54,7 +54,7 @@ from .models import (Article, BarAccount, CustomArticle, EmptyModel, FooAccount,
Report
,
MainPrepopulated
,
RelatedPrepopulated
,
UnorderedObject
,
Simple
,
UndeletableObject
,
UnchangeableObject
,
Choice
,
ShortMessage
,
Telegram
,
Pizza
,
Topping
,
FilteredManager
,
City
,
Restaurant
,
Worker
,
ParentWithDependentChildren
,
Character
,
FieldOverridePost
)
ParentWithDependentChildren
,
Character
,
FieldOverridePost
,
Color2
)
from
.admin
import
site
,
site2
,
CityAdmin
...
...
@@ -669,6 +669,38 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
with
self
.
assertRaises
(
NoReverseMatch
):
reverse
(
'admin:app_list'
,
args
=
(
'admin_views2'
,))
def
test_proxy_model_content_type_is_used_for_log_entries
(
self
):
"""
Log entries for proxy models should have the proxy model's content
type.
Regression test for #21084.
"""
color2_content_type
=
ContentType
.
objects
.
get_for_model
(
Color2
,
for_concrete_model
=
False
)
# add
color2_add_url
=
reverse
(
'admin:admin_views_color2_add'
)
self
.
client
.
post
(
color2_add_url
,
{
'value'
:
'orange'
})
color2_addition_log
=
LogEntry
.
objects
.
all
()[
0
]
self
.
assertEqual
(
color2_content_type
,
color2_addition_log
.
content_type
)
# change
color_id
=
color2_addition_log
.
object_id
color2_change_url
=
reverse
(
'admin:admin_views_color2_change'
,
args
=
(
color_id
))
self
.
client
.
post
(
color2_change_url
,
{
'value'
:
'blue'
})
color2_change_log
=
LogEntry
.
objects
.
all
()[
0
]
self
.
assertEqual
(
color2_content_type
,
color2_change_log
.
content_type
)
# delete
color2_delete_url
=
reverse
(
'admin:admin_views_color2_delete'
,
args
=
(
color_id
))
self
.
client
.
post
(
color2_delete_url
)
color2_delete_log
=
LogEntry
.
objects
.
all
()[
0
]
self
.
assertEqual
(
color2_content_type
,
color2_delete_log
.
content_type
)
@override_settings
(
TEMPLATE_DIRS
=
ADMIN_VIEW_TEMPLATES_DIR
)
class
AdminCustomTemplateTests
(
AdminViewBasicTestCase
):
...
...
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