Skip to content

Commit 3f2880a

Browse files
committed
Fix tests and compatibility with Django 5.0
1 parent d45c294 commit 3f2880a

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[pytest]
22
addopts = --nomigrations --create-db --reuse-db
33
DJANGO_SETTINGS_MODULE=settings.base
4+
django_debug_mode=true

src/dal/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def get_result_label(self, result):
9696
if self.template:
9797
return render_to_string(self.template, {"result": result})
9898
else:
99-
return result
99+
return str(result)
100100

101101
def get_selected_result_label(self, result):
102102
"""Return the label of a selected result."""

test_project/select2_list/test_fields.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ def test_init(self):
4343
def test_init_lists(self):
4444
field = autocomplete.Select2ListChoiceField(
4545
choice_list=self.choice_list_lists)
46-
self.assertCountEqual(field.choices, self.choice_list_lists)
46+
# choices are converted to tuples, not a big deal
47+
assert [*field.choices] == self.choice_list_tuples
4748

4849
field = autocomplete.Select2ListChoiceField(
4950
choice_list=self.get_choice_list_lists)
50-
self.assertCountEqual(field.choices, self.choice_list_lists)
51+
assert [*field.choices] == self.choice_list_tuples
5152

5253
def test_init_tuples(self):
5354
field = autocomplete.Select2ListChoiceField(

test_project/select2_taggit/test_forms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def test_initial(self):
6363
(str(tag), str(tag)),
6464
),
6565
attrs={
66+
'aria-describedby': 'id_test_helptext',
6667
'data-autocomplete-light-function': 'select2',
6768
'data-autocomplete-light-url': reverse(self.url_name),
6869
'data-autocomplete-light-language': 'en',

0 commit comments

Comments
 (0)