File: test_data_docstrings.py

package info (click to toggle)
python-sphinxcontrib-django 2.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 636 kB
  • sloc: python: 1,450; makefile: 20; sh: 6
file content (32 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import pytest


@pytest.mark.sphinx("html", testroot="docstrings")
def test_data(app, do_autodoc):
    options = {"members": None}
    actual = do_autodoc(app, "module", "dummy_django_app.settings", options)
    print(actual)
    assert list(actual) == [
        "",
        ".. py:module:: dummy_django_app.settings",
        "",
        "   Dummy Django settings file",
        "",
        "",
        ".. py:data:: INSTALLED_APPS",
        "   :module: dummy_django_app.settings",
        (
            "   :value: ['django.contrib.auth', 'django.contrib.contenttypes',"
            " 'dummy_django_app']"
        ),
        "",
        "   These are the installed apps",
        "",
        "   .. code-block:: JavaScript",
        "",
        (
            "       ['django.contrib.auth', 'django.contrib.contenttypes',"
            " 'dummy_django_app']\n"
        ),
        "",
    ]