mirror of
https://github.com/django-components/django-components.git
synced 2025-08-30 10:47:20 +00:00
feat: TagFormatter - Allow users to customize component template tags (#572)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
b89c09aa5f
commit
71d8679e8d
23 changed files with 1593 additions and 474 deletions
20
tests/test_utils.py
Normal file
20
tests/test_utils.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from django_components.utils import is_str_wrapped_in_quotes
|
||||
|
||||
from .django_test_setup import setup_test_config
|
||||
from .testutils import BaseTestCase
|
||||
|
||||
setup_test_config({"autodiscover": False})
|
||||
|
||||
|
||||
class UtilsTest(BaseTestCase):
|
||||
def test_is_str_wrapped_in_quotes(self):
|
||||
self.assertEqual(is_str_wrapped_in_quotes("word"), False)
|
||||
self.assertEqual(is_str_wrapped_in_quotes('word"'), False)
|
||||
self.assertEqual(is_str_wrapped_in_quotes('"word'), False)
|
||||
self.assertEqual(is_str_wrapped_in_quotes('"word"'), True)
|
||||
self.assertEqual(is_str_wrapped_in_quotes("\"word'"), False)
|
||||
self.assertEqual(is_str_wrapped_in_quotes('"word" '), False)
|
||||
self.assertEqual(is_str_wrapped_in_quotes('"'), False)
|
||||
self.assertEqual(is_str_wrapped_in_quotes(""), False)
|
||||
self.assertEqual(is_str_wrapped_in_quotes('""'), True)
|
||||
self.assertEqual(is_str_wrapped_in_quotes("\"'"), False)
|
Loading…
Add table
Add a link
Reference in a new issue