Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-commit autoupdate. #193

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8
24 changes: 7 additions & 17 deletions tests/test_layout_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,26 +275,25 @@ def test_accordion_and_accordiongroup(self):
assert parse_form(form) == parse_expected("accordion.html")

def test_accordion_css_class_is_applied(self):
classes = 'one two three'
classes = "one two three"
test_form = SampleForm()
test_form.helper = FormHelper()
test_form.helper.form_tag = False
test_form.helper.layout = Layout(
Accordion(
AccordionGroup("one", "first_name"),
css_class=classes,
css_id='super-accordion'
css_id="super-accordion",
)
)
html = render_crispy_form(test_form)

assert (
html.count('<div class="accordion %s" id="super-accordion"' % classes)
== 1
html.count('<div class="accordion %s" id="super-accordion"' % classes) == 1
)

def test_accordion_group_css_class_is_applied(self):
classes = 'one two three'
classes = "one two three"
test_form = SampleForm()
test_form.helper = FormHelper()
test_form.helper.form_tag = False
Expand All @@ -306,10 +305,7 @@ def test_accordion_group_css_class_is_applied(self):
)
html = render_crispy_form(test_form)

assert (
html.count('<div class="accordion-item %s"' % classes)
== 1
)
assert html.count('<div class="accordion-item %s"' % classes) == 1

def test_accordion_active_false_not_rendered(self):
test_form = SampleForm()
Expand Down Expand Up @@ -649,20 +645,14 @@ def test_modal(self):
test_form.helper.form_tag = False
test_form.helper.layout = Layout(
Modal(
'field1',
"field1",
css_id="modal-id-ex",
css_class="modal-class-ex",
title="This is my modal",
)
)
assert parse_form(test_form) == parse_expected("modal.html")

def test_inline_checkboxes(self):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of test from line 237.

form = CheckboxesSampleForm()
form.helper = FormHelper()
form.helper.layout = InlineRadios("checkboxes")
assert parse_form(form) == parse_expected("inline_checkboxes.html")

def test_formactions(self):
test_form = SampleForm()
test_form.helper = FormHelper()
Expand Down Expand Up @@ -695,7 +685,7 @@ def test_formactions_horizontal_form(self):
test_form = SampleForm()
test_form.helper = FormHelper()
test_form.helper.form_tag = False
test_form.helper.form_class = 'form-horizontal'
test_form.helper.form_class = "form-horizontal"
test_form.helper.layout = Layout(
FormActions(
HTML("<b>test</b>"),
Expand Down
Loading