yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.81k stars 468 forks source link

Fix unittest assertEquals warnings #1327

Closed adamchainz closed 1 year ago

adamchainz commented 1 year ago

Fix these warnings from the test run:

test_project/select2_taggit/test_forms.py::TaggitFormTest::test_save
  /.../django-autocomplete-light/test_project/select2_taggit/test_forms.py:34: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(list(result), [existing, new])

test_project/select2_foreign_key/test_functional.py::AdminForeignKeyTestCase::test_can_change_selected_option
test_project/select2_djhacker_formfield/test_functional.py::AdminForeignKeyTestCase::test_can_change_selected_option
  /.../django-autocomplete-light/src/dal/test/stories.py:283: DeprecationWarning: Please use assertEqual instead.
    self.case.assertEquals(

test_project/select2_many_to_many/test_functional.py::AdminManyToManyTestCase::test_can_create_option_on_the_fly_and_select_existing_option
test_project/select2_taggit/test_functional.py::TaggitSelect2AdminTest::test_can_select_option_in_first_inline
test_project/select2_taggit/test_functional.py::TaggitSelect2AdminTest::test_can_select_option_in_first_inline
test_project/select2_taggit/test_functional.py::TaggitSelect2AdminTest::test_can_select_options
test_project/select2_taggit/test_functional.py::TaggitSelect2AdminTest::test_can_select_options
  /.../django-autocomplete-light/src/dal/test/stories.py:387: DeprecationWarning: Please use assertEqual instead.
    self.case.assertEquals(len(values), len(actual_values))

test_project/select2_many_to_many/test_functional.py::AdminManyToManyTestCase::test_can_create_option_on_the_fly_and_select_existing_option
test_project/select2_taggit/test_functional.py::TaggitSelect2AdminTest::test_can_select_option_in_first_inline
test_project/select2_taggit/test_functional.py::TaggitSelect2AdminTest::test_can_select_option_in_first_inline
test_project/select2_taggit/test_functional.py::TaggitSelect2AdminTest::test_can_select_options
test_project/select2_taggit/test_functional.py::TaggitSelect2AdminTest::test_can_select_options
  /.../django-autocomplete-light/src/dal/test/stories.py:374: DeprecationWarning: Please use assertEqual instead.
    self.case.assertEquals(len(texts), len(labels))

test_project/select2_taggit/test_forms.py::TaggitFormTest::test_save
  /.../django-autocomplete-light/test_project/select2_taggit/test_forms.py:34: DeprecationWarning: Please use assertEqual instead.
    self.assertEquals(list(result), [existing, new])

test_project/select2_foreign_key/test_functional.py::AdminForeignKeyTestCase::test_can_change_selected_option
test_project/select2_djhacker_formfield/test_functional.py::AdminForeignKeyTestCase::test_can_change_selected_option
  /.../django-autocomplete-light/src/dal/test/stories.py:283: DeprecationWarning: Please use assertEqual instead.
    self.case.assertEquals(

assertEquals has been deprecated since Python 3.2: https://docs.python.org/3/library/unittest.html#deprecated-aliases