mirror of
https://github.com/django/django.git
synced 2025-11-22 20:16:24 +00:00
Fixed #34462 -- Made admin log actions in bulk.
This also deprecates ModelAdmin.log_deletion() and LogEntryManager.log_action().
This commit is contained in:
parent
45e0c5892f
commit
40b3975e7d
12 changed files with 374 additions and 70 deletions
|
|
@ -3808,33 +3808,27 @@ class AdminViewStringPrimaryKeyTest(TestCase):
|
|||
r"""-_.!~*'() ;/?:@&=+$, <>#%" {}|\^[]`"""
|
||||
)
|
||||
cls.m1 = ModelWithStringPrimaryKey.objects.create(string_pk=cls.pk)
|
||||
content_type_pk = ContentType.objects.get_for_model(
|
||||
ModelWithStringPrimaryKey
|
||||
).pk
|
||||
user_pk = cls.superuser.pk
|
||||
LogEntry.objects.log_action(
|
||||
LogEntry.objects.log_actions(
|
||||
user_pk,
|
||||
content_type_pk,
|
||||
cls.pk,
|
||||
cls.pk,
|
||||
[cls.m1],
|
||||
2,
|
||||
change_message="Changed something",
|
||||
single_object=True,
|
||||
)
|
||||
LogEntry.objects.log_action(
|
||||
LogEntry.objects.log_actions(
|
||||
user_pk,
|
||||
content_type_pk,
|
||||
cls.pk,
|
||||
cls.pk,
|
||||
[cls.m1],
|
||||
1,
|
||||
change_message="Added something",
|
||||
single_object=True,
|
||||
)
|
||||
LogEntry.objects.log_action(
|
||||
LogEntry.objects.log_actions(
|
||||
user_pk,
|
||||
content_type_pk,
|
||||
cls.pk,
|
||||
cls.pk,
|
||||
[cls.m1],
|
||||
3,
|
||||
change_message="Deleted something",
|
||||
single_object=True,
|
||||
)
|
||||
|
||||
def setUp(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue