Skip to content

Commit c66012a

Browse files
committed
Add test to check for u:view.
1 parent 58dadc2 commit c66012a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/components/test_unicorn_template_response.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_get_root_element_no_element():
5050
assert str(actual) == expected
5151

5252

53-
def test_get_root_element_direct_view():
53+
def test_get_root_element_direct_view_unicorn():
5454
# Annoyingly beautifulsoup adds a blank string on the attribute
5555
expected = '<div unicorn:view="">test</div>'
5656

@@ -63,6 +63,17 @@ def test_get_root_element_direct_view():
6363
assert str(actual) == expected
6464

6565

66+
def test_get_root_element_direct_view_u():
67+
# Annoyingly beautifulsoup adds a blank string on the attribute
68+
expected = '<div u:view="">test</div>'
69+
70+
component_html = "<html><head></head>≤body><div u:view>test</div></body></html>"
71+
soup = BeautifulSoup(component_html, features="html.parser")
72+
actual = get_root_element(soup)
73+
74+
assert str(actual) == expected
75+
76+
6677
def test_get_root_element_direct_view_no_view():
6778
component_html = "<html><head></head>≤body><div>test</div></body></html>"
6879
soup = BeautifulSoup(component_html, features="html.parser")

0 commit comments

Comments
 (0)