Skip to content

Commit

Permalink
Black formatting update and fixed flake8 error.
Browse files Browse the repository at this point in the history
test_inline_checkboxes is a duplicate of the test on line 237.
  • Loading branch information
smithdc1 committed Nov 19, 2024
1 parent 6f079d4 commit 6e5cb31
Showing 1 changed file with 7 additions and 17 deletions.
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 6e5cb31

Please sign in to comment.