|
|
@ -35,7 +35,7 @@ def test_empty_title_invalid(title_schema): |
|
|
|
def test_whitespace_only_title_invalid(title_schema): |
|
|
|
"""Ensure a whitespace-only title is invalid.""" |
|
|
|
with raises(ValidationError): |
|
|
|
title_schema.load({"title": " \n "}) |
|
|
|
title_schema.load({"title": " \u200D\n "}) |
|
|
|
|
|
|
|
|
|
|
|
def test_whitespace_trimmed(title_schema): |
|
|
@ -78,3 +78,13 @@ def test_unicode_control_chars_removed(title_schema): |
|
|
|
title = "nothing\u0000strange\u0085going\u009con\u007fhere" |
|
|
|
result = title_schema.load({"title": title}) |
|
|
|
assert result["title"] == "nothingstrangegoingonhere" |
|
|
|
|
|
|
|
|
|
|
|
def test_zero_width_joiners_kept(title_schema): |
|
|
|
"""Test that emojis are parsed correctly""" |
|
|
|
title = "🤷🤷♂️🤷♀️🤷🏻🤷🏻♀️🤷🏻♂️🤷🏼🤷🏼♀️🤷🏼♂️🤷🏽🤷🏽♀️🤷🏽♂️🤷🏾🤷🏾♀️🤷🏾♂️🤷🏿🤷🏿♀️🤷🏿♂️" |
|
|
|
result = title_schema.load({"title": title}) |
|
|
|
assert ( |
|
|
|
result["title"] |
|
|
|
== "🤷🤷♂️🤷♀️🤷🏻🤷🏻♀️🤷🏻♂️🤷🏼🤷🏼♀️🤷🏼♂️🤷🏽🤷🏽♀️🤷🏽♂️🤷🏾🤷🏾♀️🤷🏾♂️🤷🏿🤷🏿♀️🤷🏿♂️" |
|
|
|
) |