' in data
diff --git a/tests/test_render_hidden_errors.py b/tests/test_render_hidden_errors.py
new file mode 100644
index 00000000..27c5825b
--- /dev/null
+++ b/tests/test_render_hidden_errors.py
@@ -0,0 +1,28 @@
+from flask import render_template_string
+from flask_wtf import FlaskForm
+from wtforms import HiddenField, SubmitField
+from wtforms.validators import DataRequired
+
+
+def test_render_hidden_errors(app, client):
+ class TestForm(FlaskForm):
+ hide = HiddenField('Hide', validators=[DataRequired('Hide field is empty.')])
+ submit = SubmitField()
+
+ @app.route('/error', methods=['GET', 'POST'])
+ def error():
+ form = TestForm()
+ if form.validate_on_submit():
+ pass
+ return render_template_string('''
+ {% from 'bootstrap/form.html' import render_field, render_hidden_errors %}
+
+ ''', form=form)
+
+ response = client.post('/error', follow_redirects=True)
+ data = response.get_data(as_text=True)
+ assert 'Hide field is empty.' in data
diff --git a/tests/test_render_icon.py b/tests/test_render_icon.py
new file mode 100644
index 00000000..b0a5d3e2
--- /dev/null
+++ b/tests/test_render_icon.py
@@ -0,0 +1,71 @@
+from flask import render_template_string
+
+
+class TestIcon:
+ def test_render_icon(self, app, client):
+ @app.route('/icon')
+ def icon():
+ return render_template_string('''
+ {% from 'bootstrap/utils.html' import render_icon %}
+ {{ render_icon('heart') }}
+ ''')
+
+ @app.route('/icon-size')
+ def icon_size():
+ return render_template_string('''
+ {% from 'bootstrap/utils.html' import render_icon %}
+ {{ render_icon('heart', 32) }}
+ ''')
+
+ @app.route('/icon-style')
+ def icon_style():
+ return render_template_string('''
+ {% from 'bootstrap/utils.html' import render_icon %}
+ {{ render_icon('heart', color='primary') }}
+ ''')
+
+ @app.route('/icon-color')
+ def icon_color():
+ return render_template_string('''
+ {% from 'bootstrap/utils.html' import render_icon %}
+ {{ render_icon('heart', color='green') }}
+ ''')
+
+ response = client.get('/icon')
+ data = response.get_data(as_text=True)
+ assert 'bootstrap-icons.svg#heart' in data
+ assert 'width="1em"' in data
+ assert 'height="1em"' in data
+
+ response = client.get('/icon-size')
+ data = response.get_data(as_text=True)
+ assert 'bootstrap-icons.svg#heart' in data
+ assert 'width="32"' in data
+ assert 'height="32"' in data
+
+ response = client.get('/icon-style')
+ data = response.get_data(as_text=True)
+ assert 'bootstrap-icons.svg#heart' in data
+ assert 'text-primary' in data
+
+ response = client.get('/icon-color')
+ data = response.get_data(as_text=True)
+ assert 'bootstrap-icons.svg#heart' in data
+ assert 'style="color: green"' in data
+
+ def test_render_icon_config(self, app, client):
+ app.config['BOOTSTRAP_ICON_SIZE'] = 100
+ app.config['BOOTSTRAP_ICON_COLOR'] = 'success'
+
+ @app.route('/icon')
+ def icon():
+ return render_template_string('''
+ {% from 'bootstrap/utils.html' import render_icon %}
+ {{ render_icon('heart') }}
+ ''')
+
+ response = client.get('/icon')
+ data = response.get_data(as_text=True)
+ assert 'width="100"' in data
+ assert 'height="100"' in data
+ assert 'text-success' in data
diff --git a/tests/test_render_messages.py b/tests/test_render_messages.py
new file mode 100644
index 00000000..2c1a7437
--- /dev/null
+++ b/tests/test_render_messages.py
@@ -0,0 +1,56 @@
+from flask import flash, render_template_string
+
+
+class TestMessages:
+ def test_render_messages(self, app, client):
+ @app.route('/messages')
+ def test_messages():
+ flash('test message', 'danger')
+ return render_template_string('''
+ {% from 'bootstrap/utils.html' import render_messages %}
+ {{ render_messages() }}
+ ''')
+
+ @app.route('/container')
+ def test_container():
+ flash('test message', 'danger')
+ return render_template_string('''
+ {% from 'bootstrap/utils.html' import render_messages %}
+ {{ render_messages(container=True) }}
+ ''')
+
+ @app.route('/dismissible')
+ def test_dismissible():
+ flash('test message', 'danger')
+ return render_template_string('''
+ {% from 'bootstrap/utils.html' import render_messages %}
+ {{ render_messages(dismissible=True) }}
+ ''')
+
+ @app.route('/dismiss_animate')
+ def test_dismiss_animate():
+ flash('test message', 'danger')
+ return render_template_string('''
+ {% from 'bootstrap/utils.html' import render_messages %}
+ {{ render_messages(dismissible=True, dismiss_animate=True) }}
+ ''')
+
+ response = client.get('/messages')
+ data = response.get_data(as_text=True)
+ assert '
' in data
+
+ response = client.get('/dismissible')
+ data = response.get_data(as_text=True)
+ assert 'alert-dismissible' in data
+ assert '