From 469f79485ece7e634fa1fe2102d42e6d2d28f1ba Mon Sep 17 00:00:00 2001 From: Dylan Verheul Date: Mon, 16 Dec 2024 13:15:13 +0100 Subject: [PATCH] Add tests --- tests/test_bootstrap_button.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_bootstrap_button.py b/tests/test_bootstrap_button.py index 9fa2b64a..1567d22f 100644 --- a/tests/test_bootstrap_button.py +++ b/tests/test_bootstrap_button.py @@ -101,3 +101,16 @@ def test_button_hyphenate_attributes(self): self.render("{% bootstrap_button 'button' href='#' data_foo='bar' hx_xyz='abc' %}"), 'button', ) + + # Custom: None + with self.settings(BOOTSTRAP5={"hyphenate_attribute_prefixes": None}): + self.assertHTMLEqual( + self.render("{% bootstrap_button 'button' href='#' data_foo='bar' hx_xyz='abc' %}"), + 'button', + ) + + # Edge case: attribute name starts with prefix but prefix is not followed by underscore + self.assertHTMLEqual( + self.render("{% bootstrap_button 'button' href='#' databar_foo='bar' %}"), + 'button', + )