Skip to content

Commit

Permalink
✅[#64] fix tests for sub groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Coperh committed Sep 17, 2024
1 parent 6b932fe commit 6043e1f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ Available environment variables

{% for group_name, group_vars in vars %}
{{group_name}}
{{group_name|repeat_char:"-"}}

{% for subgroup_name, subgroup_vars in group_vars %}
{{group_name|repeat_char:"-"}}{% for subgroup_name, subgroup_vars in group_vars %}
{% if subgroup_name is not null %}
{{subgroup_name}}
{{subgroup_name|repeat_char:"^"}}
{% endif %}

{% for var in subgroup_vars %}* ``{{var.name}}``: {% if var.help_text %}{{var.help_text|safe|ensure_endswith:"."}}{% endif %}{% if var.auto_display_default and not var.default|is_undefined %} Defaults to: ``{{var.default|to_str|safe}}``.{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}{% endfor %}
{% endfor %}

{% block extra %}{% endblock %}
Expand Down
8 changes: 8 additions & 0 deletions testapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@

ROOT_URLCONF = "testapp.urls"

NOTIF_CONFIG_ENABLE = config(
"NOTIF_CONFIG_ENABLE",
default=False,
group="Setup Configuration",
sub_group="Notification Configuration",
help_text="Enable Notification Configuration",
)

# These are excluded from generate_envvar_docs test by their group
VARIABLE_TO_BE_EXCLUDED = config("VARIABLE_TO_BE_EXCLUDED1", "foo", group="Excluded")
VARIABLE_TO_BE_EXCLUDED = config("VARIABLE_TO_BE_EXCLUDED2", "bar", group="Excluded")
9 changes: 9 additions & 0 deletions tests/test_generate_envvar_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
Defaults to the inverse of ``DEBUG``.
Setup Configuration
-------------------
Notification Configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^
* ``NOTIF_CONFIG_ENABLE``: Enable Notification Configuration. Defaults to: ``False``.
Expand Down

0 comments on commit 6043e1f

Please sign in to comment.