diff --git a/CHANGES b/CHANGES index bbf51704..ea7be9a7 100644 --- a/CHANGES +++ b/CHANGES @@ -51,6 +51,7 @@ Release date to be decided. as intended with domain names. - Changed logic for picking defaults for cookie values from sessions to work better with Google Chrome. +- Added `message_flashed` signal that simplifies flashing testing. Version 0.9 ----------- diff --git a/docs/api.rst b/docs/api.rst index 12e4b966..6e08241e 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -524,6 +524,14 @@ Signals An `exc` keyword argument is passed with the exception that caused the teardown. +.. data:: message_flashed + + This signal is sent when the application is flashing a message. The + messages is sent as `message` keyword argument and the category as + `category`. + + .. versionadded:: 0.10 + .. currentmodule:: None .. class:: flask.signals.Namespace diff --git a/docs/signals.rst b/docs/signals.rst index 5f0af048..4d96cc14 100644 --- a/docs/signals.rst +++ b/docs/signals.rst @@ -291,4 +291,22 @@ The following signals exist in Flask: This will also be passed an `exc` keyword argument that has a reference to the exception that caused the teardown if there was one. +.. data:: flask.message_flashed + :noindex: + + This signal is sent when the application is flashing a message. The + messages is sent as `message` keyword argument and the category as + `category`. + + Example subscriber:: + + recorded = [] + def record(sender, message, category, **extra): + recorded.append((message, category)) + + from flask import message_flashed + message_flashed.connect(record, app) + + .. versionadded:: 0.10 + .. _blinker: http://pypi.python.org/pypi/blinker