Skip to content

Commit

Permalink
Pre-commit autoupdate and fix of lint errors. (#193)
Browse files Browse the repository at this point in the history
* Pre-commit autoupdate.

* Black formatting update and fixed flake8 error.

test_inline_checkboxes is a duplicate of the test on line 237.
  • Loading branch information
smithdc1 authored Nov 19, 2024
1 parent aecbbbb commit 18e44bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
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):
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

0 comments on commit 18e44bd

Please sign in to comment.