django-components/tests/test_utils.py
Juro Oravec 7dfcb447c4
feat: add decorator for writing component tests (#1008)
* feat: add decorator for writing component tests

* refactor: udpate changelog + update deps pins

* refactor: fix deps

* refactor: make cached_ref into generic and fix linter errors

* refactor: fix coverage testing

* refactor: use global var instead of env var for is_testing state
2025-03-02 19:46:12 +01:00

14 lines
696 B
Python

from django_components.util.misc import is_str_wrapped_in_quotes
class TestUtils:
def test_is_str_wrapped_in_quotes(self):
assert is_str_wrapped_in_quotes("word") is False
assert is_str_wrapped_in_quotes('word"') is False
assert is_str_wrapped_in_quotes('"word') is False
assert is_str_wrapped_in_quotes('"word"') is True
assert is_str_wrapped_in_quotes("\"word'") is False
assert is_str_wrapped_in_quotes('"word" ') is False
assert is_str_wrapped_in_quotes('"') is False
assert is_str_wrapped_in_quotes("") is False
assert is_str_wrapped_in_quotes('""') is True
assert is_str_wrapped_in_quotes("\"'") is False