This file is indexed.

/usr/lib/python3/dist-packages/crispy_forms/tests/conftest.py is in python3-django-crispy-forms 1.7.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
33
34
35
36
37
38
39
40
41
42
43
# coding: utf-8
import pytest

from crispy_forms.layout import HTML, Div, Field, Fieldset, Layout, Submit

only_uni_form = pytest.mark.only('uni_form')
only_bootstrap = pytest.mark.only('bootstrap', 'bootstrap3', 'bootstrap4')
only_bootstrap3 = pytest.mark.only('bootstrap3')
only_bootstrap4 = pytest.mark.only('bootstrap4')


@pytest.fixture
def advanced_layout():
    return Layout(
        Div(
            Div(Div('email')),
            Div(Field('password1')),
            Submit("save", "save"),
            Fieldset(
                "legend",
                'first_name',
                HTML("extra text"),
            ),
            Layout(
                "password2",
            ),
        ),
        'last_name',
    )


@pytest.fixture(autouse=True, params=('uni_form', 'bootstrap', 'bootstrap3',
                                      'bootstrap4'))
def template_packs(request, settings):
    check_template_pack(request._pyfuncitem._obj, request.param)
    settings.CRISPY_TEMPLATE_PACK = request.param


def check_template_pack(function, template_pack):
    if hasattr(function, 'only'):
        mark = function.only
        if template_pack not in mark.args:
            pytest.skip('Requires %s template pack' % ' or '.join(mark.args))