diff --git a/.gitignore b/.gitignore index 95ce38f..1d795ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea +.tox *.egg-info mermaid.js \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6063eaa --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = ["setuptools>=42.0", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.pytest.ini_options] +testpaths = ["tests"] +filterwarnings = ["ignore::DeprecationWarning"] \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..d48b3bc --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,5 @@ +from django.conf import settings + + +def pytest_configure(): + settings.configure(INSTALLED_APPS=["django_mermaid.apps.MermaidConfig"]) diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 0000000..e81991d --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,3 @@ +tox==3.24.3 +pytest==6.2.5 +pytest-django==4.5.2 \ No newline at end of file diff --git a/tests/test_tag.py b/tests/test_tag.py new file mode 100644 index 0000000..9f96201 --- /dev/null +++ b/tests/test_tag.py @@ -0,0 +1,8 @@ +from django_mermaid.templatetags.mermaid import mermaid + + +def test_tag_renders(): + assert mermaid("graph LR; A-->B;") == ( + """