mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-25 11:04:04 +03:00
Merge pull request #3139 from fhightower/patch-1
Removing pycharm docs if app does not use pycharm
This commit is contained in:
commit
57f9ff571b
|
@ -281,3 +281,20 @@ def test_error_if_incompatible(cookies, context, invalid_context):
|
|||
|
||||
assert result.exit_code != 0
|
||||
assert isinstance(result.exception, FailedHookException)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
["use_pycharm", "pycharm_docs_exist"],
|
||||
[
|
||||
("n", False),
|
||||
("y", True),
|
||||
],
|
||||
)
|
||||
def test_pycharm_docs_removed(cookies, context, use_pycharm, pycharm_docs_exist):
|
||||
"""."""
|
||||
context.update({"use_pycharm": use_pycharm})
|
||||
result = cookies.bake(extra_context=context)
|
||||
|
||||
with open(f"{result.project}/docs/index.rst", "r") as f:
|
||||
has_pycharm_docs = "pycharm/configuration" in f.read()
|
||||
assert has_pycharm_docs is pycharm_docs_exist
|
||||
|
|
|
@ -10,8 +10,8 @@ Welcome to {{ cookiecutter.project_name }}'s documentation!
|
|||
:maxdepth: 2
|
||||
:caption: Contents:
|
||||
|
||||
howto
|
||||
pycharm/configuration
|
||||
howto{% if cookiecutter.use_pycharm == 'y' %}
|
||||
pycharm/configuration{% endif %}
|
||||
users
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user