File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Changelog
2+
23All notable changes to this project will be documented in this file.
34
45## Unreleased
56
7+ ## [1.2.1] - 2026-02-05
8+
9+ - Add locale support
610- Add support for Python 3.13 and 3.14
711- Add support for Django 5.1 and 5.2
812- Add support for Wagtail 7.0, 7.1 and 7.2
@@ -27,11 +31,15 @@ All notable changes to this project will be documented in this file.
2731- Add testing for postgres and mysql
2832
2933## [1.0.0] - 2022-09-10
34+
3035- [#15](https://github.com/nickmoreton/wagtail-honeypot/pull/15) Add Wagtail 3/4 support and improve developer documentation and tools
3136
3237## [Yanked]
38+
3339- [#14](https://github.com/nickmoreton/wagtail-honeypot/pull/14) Add Wagtail 3.0 support
3440
3541## [0.2.0] - 2022-02-24
42+
3643### Added
44+
3745- Initial release
Original file line number Diff line number Diff line change 1+ from django .test import TestCase , override_settings
2+ from django .utils .translation import gettext_lazy , override
3+
4+ from wagtail_honeypot .models import HoneypotFormMixin
5+
6+
7+ class TestHoneypotFormMixinLocale (TestCase ):
8+ """
9+ Test the locale/translation support of HoneypotFormMixin
10+ """
11+
12+ def test_honeypot_field_verbose_name_is_translatable (self ):
13+ """
14+ Test that the honeypot field's verbose_name is a lazy translation object
15+ """
16+ field = HoneypotFormMixin ._meta .get_field ("honeypot" )
17+ self .assertIsInstance (field .verbose_name , type (gettext_lazy ("test" )))
18+
19+ def test_honeypot_field_verbose_name_default (self ):
20+ """
21+ Test that the honeypot field's verbose_name is set correctly in English
22+ """
23+ field = HoneypotFormMixin ._meta .get_field ("honeypot" )
24+ # Convert lazy translation to string to check content
25+ self .assertEqual (str (field .verbose_name ), "Honeypot enabled" )
26+
27+ @override_settings (LANGUAGE_CODE = "fr" )
28+ def test_honeypot_field_verbose_name_french_locale (self ):
29+ """
30+ Test that the honeypot field's verbose_name can be translated to French
31+ """
32+ with override ("fr" ):
33+ field = HoneypotFormMixin ._meta .get_field ("honeypot" )
34+ # The verbose_name should still be available for translation
35+ verbose_name = str (field .verbose_name )
36+ self .assertIsNotNone (verbose_name )
37+ self .assertTrue (len (verbose_name ) > 0 )
Original file line number Diff line number Diff line change 1- VERSION = (1 , 1 , 0 )
1+ VERSION = (1 , 2 , 1 )
22__version__ = "." .join (map (str , VERSION ))
You can’t perform that action at this time.
0 commit comments