diff --git a/django-stubs/contrib/messages/storage/cookie.pyi b/django-stubs/contrib/messages/storage/cookie.pyi index 39f4fe2cb..b6e6ae592 100644 --- a/django-stubs/contrib/messages/storage/cookie.pyi +++ b/django-stubs/contrib/messages/storage/cookie.pyi @@ -1,5 +1,5 @@ import json -from typing import Any +from typing import Any, Callable, Sequence from django.contrib.messages.storage.base import BaseStorage @@ -14,7 +14,20 @@ class MessageEncoder(json.JSONEncoder): class MessageDecoder(json.JSONDecoder): def process_messages(self, obj: Any) -> Any: ... +class MessagePartSerializer: + def dumps(self, obj: Any) -> Sequence[str]: ... + +class MessagePartGatherSerializer: + def dumps(self, obj: Any) -> bytes: ... + +class MessageSerializer: + def loads(self, data: bytes | bytearray) -> Any: ... + class CookieStorage(BaseStorage): cookie_name: str max_cookie_size: int not_finished: str + not_finished_json: str + +def bisect_keep_left(a: list[int], fn: Callable[[list[int]], bool]) -> int: ... +def bisect_keep_right(a: list[int], fn: Callable[[list[int]], bool]) -> int: ... diff --git a/scripts/stubtest/allowlist_todo.txt b/scripts/stubtest/allowlist_todo.txt index 1ca5fb4be..ee4587b36 100644 --- a/scripts/stubtest/allowlist_todo.txt +++ b/scripts/stubtest/allowlist_todo.txt @@ -496,7 +496,6 @@ django.contrib.humanize.templatetags.humanize.intword_converters django.contrib.messages.storage.cookie.CookieStorage.key_salt django.contrib.messages.storage.cookie.MessageDecoder.decode django.contrib.messages.storage.cookie.MessageEncoder.default -django.contrib.messages.storage.cookie.MessageSerializer django.contrib.postgres.fields.ArrayField.formfield django.contrib.postgres.fields.CIText.__init__ django.contrib.postgres.fields.HStoreField.formfield diff --git a/scripts/stubtest/allowlist_todo_django50.txt b/scripts/stubtest/allowlist_todo_django50.txt index a63d83892..995c3c77c 100644 --- a/scripts/stubtest/allowlist_todo_django50.txt +++ b/scripts/stubtest/allowlist_todo_django50.txt @@ -36,11 +36,6 @@ django.contrib.gis.management django.contrib.gis.management.commands django.contrib.gis.management.commands.inspectdb django.contrib.gis.management.commands.ogrinspect -django.contrib.messages.storage.cookie.CookieStorage.not_finished_json -django.contrib.messages.storage.cookie.MessagePartGatherSerializer -django.contrib.messages.storage.cookie.MessagePartSerializer -django.contrib.messages.storage.cookie.bisect_keep_left -django.contrib.messages.storage.cookie.bisect_keep_right django.contrib.messages.test django.db.backends.base.features.BaseDatabaseFeatures.delete_can_self_reference_subquery django.db.backends.base.features.BaseDatabaseFeatures.insert_test_table_with_defaults