Three tests fail (test_show_label_skip, test_radio_select, and test_form_check_class)
mcepl opened this issue · 3 comments
mcepl commented
When packaging django-bootstrap4 2.3.1, Django 4.0.2, and reproducible on Python 3.8, 3.9, and 3.10 I get three tests failing:
[ 25s] + PYTHONPATH=/home/abuild/rpmbuild/BUILDROOT/python-django-bootstrap4-2.3.1-0.x86_64/usr/lib/python3.8/site-packages
[ 25s] + python3.8 manage.py test -v1 --noinput
[ 25s] Found 72 test(s).
[ 25s] Creating test database for alias 'default'...
[ 25s] System check identified no issues (0 silenced).
[ 26s] .......................F...................F.....................F......
[ 26s] ======================================================================
[ 26s] FAIL: test_form_check_class (tests.test_templatetags.BootstrapFormTest)
[ 26s] ----------------------------------------------------------------------
[ 26s] Traceback (most recent call last):
[ 26s] File "/home/abuild/rpmbuild/BUILD/django-bootstrap4-2.3.1/tests/test_templatetags.py", line 190, in test_form_check_class
[ 26s] self.assertIn('div class="form-check form-check-inline"', res)
[ 26s] AssertionError: 'div class="form-check form-check-inline"' not found in '<div class="form-group"><label for="id_date">Date</label><input type="text" name="date" class="form-control" placeholder="Date" title="" id="id_date"></div>\n<div class="form-group"><label for="id_datetime_0">Datetime</label><p class="datetime">\n Date: <input type="text" name="datetime_0" class="form-control vDateField" size="10" placeholder="Datetime" title="" id="id_datetime_0">\n\n<br>\n Time: <input type="text" name="datetime_1" class="form-control vTimeField" size="8" placeholder="Datetime" title="" id="id_datetime_1">\n\n\n</p></div>\n<div class="form-group bootstrap4-req"><label for="id_subject">Subject</label><input type="text" name="subject" placeholder="placeholdertest" maxlength="100" class="form-control" title="my_help_text" id="id_subject">\n <small class="form-text text-muted">my_help_text</small>\n\n</div>\n<div class="form-group bootstrap4-req"><label for="id_xss_field">XSS" onmouseover="alert('Hello, XSS')" foo="</label><input type="text" name="xss_field" maxlength="100" class="form-control" placeholder="XSS" onmouseover="alert('Hello, XSS')" foo="" title="" id="id_xss_field"></div>\n<div class="form-group bootstrap4-req"><label for="id_password">Password</label><input type="password" name="password" class="form-control" placeholder="Password" title="" id="id_password"></div>\n<div class="form-group"><label for="id_message">Message</label><input type="text" name="message" class="form-control" placeholder="Message" title="my_help_text" id="id_message">\n <small class="form-text text-muted"><i>my_help_text</i></small>\n\n</div>\n<div class="form-group bootstrap4-req"><label for="id_sender">Sender © unicode</label><input type="email" name="sender" class="form-control" placeholder="Sender © unicode" title="E.g., "me@example.com"" id="id_sender">\n <small class="form-text text-muted">E.g., "me@example.com"</small>\n\n</div>\n<input type="hidden" name="secret" value="42" id="id_secret">\n<div class="form-group"><div class="form-check"><input type="checkbox" name="cc_myself" class="form-check-input" id="id_cc_myself"><label class="form-check-label" for="id_cc_myself" title="cc stands for "carbon copy." You will get a copy in your mailbox.">Cc myself</label>\n <small class="form-text text-muted">cc stands for "carbon copy." You will get a copy in your mailbox.</small>\n\n</div></div>\n<div class="form-group bootstrap4-req"><label for="id_select1">Select1</label><select name="select1" class="form-control" title="" id="id_select1">\n <option value="1">Radio 1</option>\n\n <option value="2">Radio 2</option>\n\n</select></div>\n<div class="form-group bootstrap4-req"><label for="id_select2">Select2</label><select name="select2" class="form-control" title="Check as many as you like." id="id_select2" multiple>\n <option value="1">Radio 1</option>\n\n <option value="2">Radio 2</option>\n\n</select>\n <small class="form-text text-muted">Check as many as you like.</small>\n\n</div>\n<div class="form-group bootstrap4-req"><label for="id_select3">Select3</label><select name="select3" class="form-control" title="" id="id_select3">\n <optgroup label="Audio">\n <option value="vinyl">Vinyl</option>\n\n <option value="cd">CD</option>\n\n </optgroup>\n <optgroup label="Video">\n <option value="vhs">VHS Tape</option>\n\n <option value="dvd">DVD</option>\n\n </optgroup>\n <option value="unknown">Unknown</option>\n\n</select></div>\n<div class="form-group bootstrap4-req"><label for="id_select4">Select4</label><select name="select4" class="form-control" title="Check as many as you like." id="id_select4" multiple>\n <optgroup label="Audio">\n <option value="vinyl">Vinyl</option>\n\n <option value="cd">CD</option>\n\n </optgroup>\n <optgroup label="Video">\n <option value="vhs">VHS Tape</option>\n\n <option value="dvd">DVD</option>\n\n </optgroup>\n <option value="unknown">Unknown</option>\n\n</select>\n <small class="form-text text-muted">Check as many as you like.</small>\n\n</div>\n<div class="form-group bootstrap4-req"><label>Category1</label><div id="id_category1"><div>\n<label for="id_category1_0"><input class="" id="id_category1_0" name="category1" title="" type="radio" value="1"/>\n Radio 1</label>\n</div><div>\n<label for="id_category1_1"><input class="" id="id_category1_1" name="category1" title="" type="radio" value="2"/>\n Radio 2</label>\n</div>\n</div></div>\n<div class="form-group bootstrap4-req"><label>Category2</label><div id="id_category2"><div>\n<label for="id_category2_0"><input class="" id="id_category2_0" name="category2" title="Check as many as you like." type="checkbox" value="1"/>\n Radio 1</label>\n</div><div>\n<label for="id_category2_1"><input class="" id="id_category2_1" name="category2" title="Check as many as you like." type="checkbox" value="2"/>\n Radio 2</label>\n</div>\n</div>\n <small class="form-text text-muted">Check as many as you like.</small>\n\n</div>\n<div class="form-group bootstrap4-req"><label>Category3</label><div id="id_category3">\n<div><label>Audio</label><div>\n<label for="id_category3_0_0"><input class="" id="id_category3_0_0" name="category3" title="" type="radio" value="vinyl"/>\n Vinyl</label>\n</div><div>\n<label for="id_category3_0_1"><input class="" id="id_category3_0_1" name="category3" title="" type="radio" value="cd"/>\n CD</label>\n</div>\n</div>\n<div><label>Video</label><div>\n<label for="id_category3_1_0"><input class="" id="id_category3_1_0" name="category3" title="" type="radio" value="vhs"/>\n VHS Tape</label>\n</div><div>\n<label for="id_category3_1_1"><input class="" id="id_category3_1_1" name="category3" title="" type="radio" value="dvd"/>\n DVD</label>\n</div>\n</div><div>\n<label for="id_category3_2"><input class="" id="id_category3_2" name="category3" title="" type="radio" value="unknown"/>\n Unknown</label>\n</div>\n</div></div>\n<div class="form-group bootstrap4-req"><label>Category4</label><div id="id_category4">\n<div><label>Audio</label><div>\n<label for="id_category4_0_0"><input class="" id="id_category4_0_0" name="category4" title="Check as many as you like." type="checkbox" value="vinyl"/>\n Vinyl</label>\n</div><div>\n<label for="id_category4_0_1"><input class="" id="id_category4_0_1" name="category4" title="Check as many as you like." type="checkbox" value="cd"/>\n CD</label>\n</div>\n</div>\n<div><label>Video</label><div>\n<label for="id_category4_1_0"><input class="" id="id_category4_1_0" name="category4" title="Check as many as you like." type="checkbox" value="vhs"/>\n VHS Tape</label>\n</div><div>\n<label for="id_category4_1_1"><input class="" id="id_category4_1_1" name="category4" title="Check as many as you like." type="checkbox" value="dvd"/>\n DVD</label>\n</div>\n</div><div>\n<label for="id_category4_2"><input class="" id="id_category4_2" name="category4" title="Check as many as you like." type="checkbox" value="unknown"/>\n Unknown</label>\n</div>\n</div>\n <small class="form-text text-muted">Check as many as you like.</small>\n\n</div>\n<div class="form-group bootstrap4-req"><label>Category5</label><div class="btn-group btn-group-toggle" data-toggle="buttons" id="id_category5">\n<label class="btn btn-outline-primary" id="id_category5">\n<input id="id_category5_0_0" name="category5" required="" type="radio" value="vinyl"/> Vinyl\n </label>\n<label class="btn btn-outline-primary" id="id_category5">\n<input id="id_category5_0_1" name="category5" required="" type="radio" value="cd"/> CD\n </label>\n<label class="btn btn-outline-primary" id="id_category5">\n<input id="id_category5_1_0" name="category5" required="" type="radio" value="vhs"/> VHS Tape\n </label>\n<label class="btn btn-outline-primary" id="id_category5">\n<input id="id_category5_1_1" name="category5" required="" type="radio" value="dvd"/> DVD\n </label>\n<label class="btn btn-outline-primary" id="id_category5">\n<input id="id_category5_2" name="category5" required="" type="radio" value="unknown"/> Unknown\n </label>\n</div></div>\n<div class="form-group bootstrap4-req"><label for="id_addon">Addon</label><div class="input-group"><div class="input-group-prepend"><span class="input-group-text">before</span></div><input type="text" name="addon" class="form-control" placeholder="Addon" title="" id="id_addon"><div class="input-group-append"><span class="input-group-text">after</span></div></div></div>'
[ 26s]
[ 26s] ======================================================================
[ 26s] FAIL: test_radio_select (tests.test_templatetags.FieldTest)
[ 26s] Test RadioSelect rendering, because it is special.
[ 26s] ----------------------------------------------------------------------
[ 26s] Traceback (most recent call last):
[ 26s] File "/home/abuild/rpmbuild/BUILD/django-bootstrap4-2.3.1/tests/test_templatetags.py", line 335, in test_radio_select
[ 26s] radio = self._select_one_element(form_group, ".radio", "There should be a .radio inside .form-group")
[ 26s] File "/home/abuild/rpmbuild/BUILD/django-bootstrap4-2.3.1/tests/test_templatetags.py", line 283, in _select_one_element
[ 26s] self.assertEqual(len(lst), 1, err_msg)
[ 26s] AssertionError: 0 != 1 : There should be a .radio inside .form-group
[ 26s]
[ 26s] ======================================================================
[ 26s] FAIL: test_show_label_skip (tests.test_templatetags.ShowLabelTest)
[ 26s] ----------------------------------------------------------------------
[ 26s] Traceback (most recent call last):
[ 26s] File "/home/abuild/rpmbuild/BUILD/django-bootstrap4-2.3.1/tests/test_templatetags.py", line 644, in test_show_label_skip
[ 26s] self.assertNotIn("<label>", res)
[ 26s] AssertionError: '<label>' unexpectedly found in '<div class="form-group"><input type="text" name="date" class="form-control" placeholder="Date" title="" id="id_date"></div>\n<div class="form-group"><p class="datetime">\n Date: <input type="text" name="datetime_0" class="form-control vDateField" size="10" placeholder="Datetime" title="" id="id_datetime_0">\n\n<br>\n Time: <input type="text" name="datetime_1" class="form-control vTimeField" size="8" placeholder="Datetime" title="" id="id_datetime_1">\n\n\n</p></div>\n<div class="form-group bootstrap4-req"><input type="text" name="subject" placeholder="placeholdertest" maxlength="100" class="form-control" title="my_help_text" id="id_subject">\n <small class="form-text text-muted">my_help_text</small>\n\n</div>\n<div class="form-group bootstrap4-req"><input type="text" name="xss_field" maxlength="100" class="form-control" placeholder="XSS" onmouseover="alert('Hello, XSS')" foo="" title="" id="id_xss_field"></div>\n<div class="form-group bootstrap4-req"><input type="password" name="password" class="form-control" placeholder="Password" title="" id="id_password"></div>\n<div class="form-group"><input type="text" name="message" class="form-control" placeholder="Message" title="my_help_text" id="id_message">\n <small class="form-text text-muted"><i>my_help_text</i></small>\n\n</div>\n<div class="form-group bootstrap4-req"><input type="email" name="sender" class="form-control" placeholder="Sender © unicode" title="E.g., "me@example.com"" id="id_sender">\n <small class="form-text text-muted">E.g., "me@example.com"</small>\n\n</div>\n<input type="hidden" name="secret" value="42" id="id_secret">\n<div class="form-group"><div class="form-check"><input type="checkbox" name="cc_myself" class="form-check-input" id="id_cc_myself"><label class="form-check-label" for="id_cc_myself" title="cc stands for "carbon copy." You will get a copy in your mailbox.">Cc myself</label>\n <small class="form-text text-muted">cc stands for "carbon copy." You will get a copy in your mailbox.</small>\n\n</div></div>\n<div class="form-group bootstrap4-req"><select name="select1" class="form-control" title="" id="id_select1">\n <option value="1">Radio 1</option>\n\n <option value="2">Radio 2</option>\n\n</select></div>\n<div class="form-group bootstrap4-req"><select name="select2" class="form-control" title="Check as many as you like." id="id_select2" multiple>\n <option value="1">Radio 1</option>\n\n <option value="2">Radio 2</option>\n\n</select>\n <small class="form-text text-muted">Check as many as you like.</small>\n\n</div>\n<div class="form-group bootstrap4-req"><select name="select3" class="form-control" title="" id="id_select3">\n <optgroup label="Audio">\n <option value="vinyl">Vinyl</option>\n\n <option value="cd">CD</option>\n\n </optgroup>\n <optgroup label="Video">\n <option value="vhs">VHS Tape</option>\n\n <option value="dvd">DVD</option>\n\n </optgroup>\n <option value="unknown">Unknown</option>\n\n</select></div>\n<div class="form-group bootstrap4-req"><select name="select4" class="form-control" title="Check as many as you like." id="id_select4" multiple>\n <optgroup label="Audio">\n <option value="vinyl">Vinyl</option>\n\n <option value="cd">CD</option>\n\n </optgroup>\n <optgroup label="Video">\n <option value="vhs">VHS Tape</option>\n\n <option value="dvd">DVD</option>\n\n </optgroup>\n <option value="unknown">Unknown</option>\n\n</select>\n <small class="form-text text-muted">Check as many as you like.</small>\n\n</div>\n<div class="form-group bootstrap4-req"><div id="id_category1"><div>\n<label for="id_category1_0"><input class="" id="id_category1_0" name="category1" title="" type="radio" value="1"/>\n Radio 1</label>\n</div><div>\n<label for="id_category1_1"><input class="" id="id_category1_1" name="category1" title="" type="radio" value="2"/>\n Radio 2</label>\n</div>\n</div></div>\n<div class="form-group bootstrap4-req"><div id="id_category2"><div>\n<label for="id_category2_0"><input class="" id="id_category2_0" name="category2" title="Check as many as you like." type="checkbox" value="1"/>\n Radio 1</label>\n</div><div>\n<label for="id_category2_1"><input class="" id="id_category2_1" name="category2" title="Check as many as you like." type="checkbox" value="2"/>\n Radio 2</label>\n</div>\n</div>\n <small class="form-text text-muted">Check as many as you like.</small>\n\n</div>\n<div class="form-group bootstrap4-req"><div id="id_category3">\n<div><label>Audio</label><div>\n<label for="id_category3_0_0"><input class="" id="id_category3_0_0" name="category3" title="" type="radio" value="vinyl"/>\n Vinyl</label>\n</div><div>\n<label for="id_category3_0_1"><input class="" id="id_category3_0_1" name="category3" title="" type="radio" value="cd"/>\n CD</label>\n</div>\n</div>\n<div><label>Video</label><div>\n<label for="id_category3_1_0"><input class="" id="id_category3_1_0" name="category3" title="" type="radio" value="vhs"/>\n VHS Tape</label>\n</div><div>\n<label for="id_category3_1_1"><input class="" id="id_category3_1_1" name="category3" title="" type="radio" value="dvd"/>\n DVD</label>\n</div>\n</div><div>\n<label for="id_category3_2"><input class="" id="id_category3_2" name="category3" title="" type="radio" value="unknown"/>\n Unknown</label>\n</div>\n</div></div>\n<div class="form-group bootstrap4-req"><div id="id_category4">\n<div><label>Audio</label><div>\n<label for="id_category4_0_0"><input class="" id="id_category4_0_0" name="category4" title="Check as many as you like." type="checkbox" value="vinyl"/>\n Vinyl</label>\n</div><div>\n<label for="id_category4_0_1"><input class="" id="id_category4_0_1" name="category4" title="Check as many as you like." type="checkbox" value="cd"/>\n CD</label>\n</div>\n</div>\n<div><label>Video</label><div>\n<label for="id_category4_1_0"><input class="" id="id_category4_1_0" name="category4" title="Check as many as you like." type="checkbox" value="vhs"/>\n VHS Tape</label>\n</div><div>\n<label for="id_category4_1_1"><input class="" id="id_category4_1_1" name="category4" title="Check as many as you like." type="checkbox" value="dvd"/>\n DVD</label>\n</div>\n</div><div>\n<label for="id_category4_2"><input class="" id="id_category4_2" name="category4" title="Check as many as you like." type="checkbox" value="unknown"/>\n Unknown</label>\n</div>\n</div>\n <small class="form-text text-muted">Check as many as you like.</small>\n\n</div>\n<div class="form-group bootstrap4-req"><div class="btn-group btn-group-toggle" data-toggle="buttons" id="id_category5">\n<label class="btn btn-outline-primary" id="id_category5">\n<input id="id_category5_0_0" name="category5" required="" type="radio" value="vinyl"/> Vinyl\n </label>\n<label class="btn btn-outline-primary" id="id_category5">\n<input id="id_category5_0_1" name="category5" required="" type="radio" value="cd"/> CD\n </label>\n<label class="btn btn-outline-primary" id="id_category5">\n<input id="id_category5_1_0" name="category5" required="" type="radio" value="vhs"/> VHS Tape\n </label>\n<label class="btn btn-outline-primary" id="id_category5">\n<input id="id_category5_1_1" name="category5" required="" type="radio" value="dvd"/> DVD\n </label>\n<label class="btn btn-outline-primary" id="id_category5">\n<input id="id_category5_2" name="category5" required="" type="radio" value="unknown"/> Unknown\n </label>\n</div></div>\n<div class="form-group bootstrap4-req"><div class="input-group"><div class="input-group-prepend"><span class="input-group-text">before</span></div><input type="text" name="addon" class="form-control" placeholder="Addon" title="" id="id_addon"><div class="input-group-append"><span class="input-group-text">after</span></div></div></div>'
[ 26s]
[ 26s] ----------------------------------------------------------------------
[ 26s] Ran 72 tests in 0.603s
[ 26s]
[ 26s] FAILED (failures=3)
Complete build log contains versions of all packages used and steps taken.
mcepl commented
Sorry, wrong version.
mcepl commented
Yup, and I can fully reproduce with 21.2.
Complete build log again.
dyve commented
Closing this since it doesn't show up in the CI (anymore).