diff --git a/CHANGES.md b/CHANGES.md index 86c6f23..e148b70 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ # Changelog +**9.5.0** (2024-02-02) + * Downgraded sphinx to 7.1.* for Python 3.8 compatability + **9.4.4** (2024-01-22) * Downgraded sphinx to 7.1.* for Python 3.8 compatability diff --git a/ambient_toolbox/__init__.py b/ambient_toolbox/__init__.py index fa4d210..0c4a14a 100644 --- a/ambient_toolbox/__init__.py +++ b/ambient_toolbox/__init__.py @@ -1,3 +1,3 @@ """Python toolbox of Ambient Digital containing an abundance of useful tools and gadgets.""" -__version__ = "9.4.4" +__version__ = "9.5.0" diff --git a/ambient_toolbox/tests/mixins.py b/ambient_toolbox/tests/mixins.py index 17c8ebf..4d5354b 100644 --- a/ambient_toolbox/tests/mixins.py +++ b/ambient_toolbox/tests/mixins.py @@ -138,3 +138,13 @@ def assert_partial_message_in_request(self, request: WSGIRequest, message: str) message_found = True self.assertTrue(message_found, f"Message part {message!r} not found in request.") + + def assert_message_not_in_request(self, request: WSGIRequest, message: str) -> None: + messages = list(get_messages(request)) + + message_found = False + for request_message in messages: + if str(request_message) == message: + message_found = True + + self.assertFalse(message_found, f"Message {message!r} not found in request.") diff --git a/tests/tests/mixins/test_django_message_framework.py b/tests/tests/mixins/test_django_message_framework.py index 410ce29..205a40d 100644 --- a/tests/tests/mixins/test_django_message_framework.py +++ b/tests/tests/mixins/test_django_message_framework.py @@ -18,3 +18,7 @@ def test_full_message_found(self): def test_partial_message_found(self): messages.add_message(self.request, messages.INFO, "My message") self.assert_partial_message_in_request(request=self.request, message="My") + + def test_message_not_found(self): + messages.add_message(self.request, messages.INFO, "My message") + self.assert_message_not_in_request(request=self.request, message="Ninja")