built new beautifulsoup function to apply

html tags to markdown file once processed
with test cases.
This commit is contained in:
Anastasia Gradova
2024-01-03 22:01:07 -07:00
parent a884bef77b
commit 7a1d9cf705
5 changed files with 60 additions and 29 deletions

View File

@@ -7,6 +7,7 @@ from freezegun import freeze_time
from app.formatters import (
convert_markdown_template,
apply_html_class,
email_safe,
format_datetime_relative,
format_delta,
@@ -181,3 +182,7 @@ def test_markdown_format(fake_markdown_file):
app = Flask("app")
with app.app_context():
assert convert_markdown_template(fake_markdown_file, test=True) == "<h1>Test</h1>"
@pytest.mark.usefixtures("fake_soup_template")
def test_soup_format(fake_soup_template):
assert apply_html_class([['h1', 'testClass']], fake_soup_template) == '<h1 class="testClass">Test</h1>'