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.8k stars 467 forks source link

fix Select2GroupQuerySetView #1222

Closed arseniy-panfilov closed 3 years ago

arseniy-panfilov commented 3 years ago

Hello!

Tried to use this new base view today (PR #1186) but ran into some issues, namely it would crash at line 113:

'title': result.descricao  # raises AttributeError

I suspect that it could be a project-specific property used by the author of original PR, so I though I'd replace it with the methods used throughout the repo to resolve id/text of the resulting items.

Sadly I wasn't able to add some test coverage; in fact I wasn't able to run existing tests either - would love if somebody could guide me as there seem to be quite a lot of setup. That said, I've tested proposed implementation manually and can confirm it works just fine.

jpic commented 3 years ago

Thank you for your contribution!

What happens if you run tox -e py39-dj31? (change 39 by whatever python version you have)

It's working fine here (on Linux):

$ tox -e py39-dj31
py39-dj31 recreate: /home/jpic/src/dal/.tox/py39-dj31
py39-dj31 installdeps: Django==3.1.*, -rtest_project/requirements.txt
py39-dj31 develop-inst: /home/jpic/src/dal
py39-dj31 installed: asgiref==3.3.4,attrs==20.3.0,coverage==5.5,Django==3.1.8,-e git+git@github.com:yourlabs/django-autocomplete-light.git@6fef810c68881a94183681b8f09caf43d61902a7#egg=django_autocomplete_light,django-debug-toolbar==3.2.1,django-extensions==3.1.3,django-generic-m2m==0.3.1,django-gm2m==1.1.1,django-nested-admin==3.3.3,django-querysetsequence==0.14,django-tagging==0.5.0,django-taggit==1.4.0,iniconfig==1.1.1,mock==4.0.3,packaging==20.9,pluggy==0.13.1,py==1.10.0,pyparsing==2.4.7,pytest==6.2.3,pytest-cov==2.11.1,pytest-django==4.2.0,pytest-splinter==3.3.1,python-monkey-business==1.0.0,pytz==2021.1,selenium==3.141.0,six==1.15.0,splinter==0.14.0,sqlparse==0.4.1,tenacity==7.0.0,toml==0.10.2,urllib3==1.26.4,whitenoise==5.2.0
py39-dj31 run-test-pre: PYTHONHASHSEED='66582355'
py39-dj31 run-test: commands[0] | py.test -v --cov --liveserver 127.0.0.1:9999 secure_data rename_forward select2_foreign_key select2_generic_foreign_key select2_list select2_many_to_many select2_one_to_one select2_outside_admin select2_taggit custom_select2 select2_nestedadmin
========================== test session starts ==========================
platform linux -- Python 3.9.4, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /home/jpic/src/dal/.tox/py39-dj31/bin/python
cachedir: .tox/py39-dj31/.pytest_cache
django: settings: settings.base (from env)
rootdir: /home/jpic/src/dal, configfile: pytest.ini
plugins: splinter-3.3.1, django-4.2.0, cov-2.11.1
collected 48 items                                                      

select2_generic_foreign_key/test_forms.py::GenericFormTest::test_initial PASSED [  2%]
select2_generic_foreign_key/test_forms.py::GenericFormTest::test_model_name PASSED [  4%]
select2_generic_foreign_key/test_forms.py::GenericFormTest::test_model_name_index_error PASSED [  6%]
select2_generic_foreign_key/test_forms.py::GenericFormTest::test_save PASSED [  8%]
select2_generic_foreign_key/test_forms.py::GenericFormTest::test_validate PASSED [ 10%]
select2_list/test_fields.py::Select2ListChoiceFieldTest::test_init PASSED [ 12%]
select2_list/test_fields.py::Select2ListChoiceFieldTest::test_init_lists PASSED [ 14%]
select2_list/test_fields.py::Select2ListChoiceFieldTest::test_init_tuples PASSED [ 16%]
select2_list/test_fields.py::Select2ListCreateChoiceFieldTest::test_validate PASSED [ 18%]
select2_list/test_views.py::Select2ListViewTest::test_case_insensitive_results PASSED [ 20%]
select2_list/test_views.py::Select2ListViewTest::test_empty PASSED [ 22%]
select2_list/test_views.py::Select2ListViewTest::test_post_fail PASSED [ 25%]
select2_list/test_views.py::Select2ProvidedValueListViewTest::test_case_insensitive_id_results PASSED [ 27%]
select2_list/test_views.py::Select2ProvidedValueListViewTest::test_case_insensitive_results PASSED [ 29%]
select2_list/test_views.py::Select2ProvidedValueListViewTest::test_empty PASSED [ 31%]
select2_list/test_views.py::Select2ProvidedValueListViewTest::test_post_fail PASSED [ 33%]
select2_list/test_views.py::Select2GroupListViewTest::test_group_result PASSED [ 35%]
select2_list/test_views.py::Select2GroupListViewTest::test_string_in_group PASSED [ 37%]
select2_list/test_views.py::Select2GroupListViewTest::test_weird_in_group PASSED [ 39%]
select2_list/test_views.py::Select2GroupProvidedValueListViewTest::test_group_result PASSED [ 41%]
select2_list/test_views.py::Select2GroupProvidedValueListViewTest::test_string_in_group PASSED [ 43%]
select2_list/test_views.py::Select2GroupProvidedValueListViewTest::test_weird_in_group PASSED [ 45%]
select2_taggit/test_forms.py::TaggitFormTest::test_initial PASSED [ 47%]
select2_taggit/test_forms.py::TaggitFormTest::test_multi_words_tag PASSED [ 50%]
select2_taggit/test_forms.py::TaggitFormTest::test_save PASSED    [ 52%]
secure_data/test_functional.py::AdminLinkedDataTest::test_filtered_options PASSED [ 54%]
rename_forward/test_functional.py::RenameForwardAdminLinkedDataTestTest::test_can_select_option_in_first_extra_inline PASSED [ 56%]
rename_forward/test_functional.py::RenameForwardAdminLinkedDataTestTest::test_filter_option_in_first_inline PASSED [ 58%]
rename_forward/test_functional.py::RenameForwardAdminLinkedDataTestTest::test_filter_options PASSED [ 60%]
select2_foreign_key/test_functional.py::AdminForeignKeyTestCase::test_can_add_another_option PASSED [ 62%]
select2_foreign_key/test_functional.py::AdminForeignKeyTestCase::test_can_change_selected_option PASSED [ 64%]
select2_foreign_key/test_functional.py::AdminForeignKeyTestCase::test_can_select_option PASSED [ 66%]
select2_foreign_key/test_functional.py::AdminForeignKeyTestCase::test_can_select_option_in_first_extra_inline PASSED [ 68%]
select2_foreign_key/test_functional.py::AdminForeignKeyTestCase::test_can_select_option_in_first_inline PASSED [ 70%]
select2_foreign_key/test_functional.py::AdminForeignKeyTestCase::test_can_unselect_option PASSED [ 72%]
select2_generic_foreign_key/test_functional.py::AdminGenericForeignKeyTestCase::test_can_select_option PASSED [ 75%]
select2_generic_foreign_key/test_functional.py::AdminGenericForeignKeyTestCase::test_can_select_option_in_first_extra_inline PASSED [ 77%]
select2_generic_foreign_key/test_functional.py::AdminGenericForeignKeyTestCase::test_can_select_option_in_first_inline PASSED [ 79%]
select2_list/test_functional.py::AdminSelect2List::test_can_change_selected_option PASSED [ 81%]
select2_list/test_functional.py::AdminSelect2List::test_can_create_new_option PASSED [ 83%]
select2_list/test_functional.py::AdminSelect2List::test_can_select_option PASSED [ 85%]
select2_list/test_functional.py::AdminSelect2List::test_can_select_option_in_first_extra_inline PASSED [ 87%]
select2_list/test_functional.py::AdminSelect2List::test_can_select_option_in_first_inline PASSED [ 89%]
select2_many_to_many/test_functional.py::AdminManyToManyTestCase::test_can_create_option_on_the_fly_and_select_existing_option PASSED [ 91%]
select2_one_to_one/test_functional.py::AdminOneToOneTestCase::test_can_create_option_on_the_fly PASSED [ 93%]
select2_taggit/test_functional.py::TaggitSelect2AdminTest::test_can_select_option_in_first_inline PASSED [ 95%]
select2_taggit/test_functional.py::TaggitSelect2AdminTest::test_can_select_options PASSED              [ 97%]
select2_nestedadmin/test_functional.py::AdminNestedLinkedDataTest::test_linked_value_is_forwarded_for_nested_admin PASSED [100%]

============================================== warnings summary ==============================================....
----------- coverage: platform linux, python 3.9.4-final-0 -----------
Name                                                               Stmts   Miss  Cover
--------------------------------------------------------------------------------------
/home/jpic/src/dal/conftest.py                                         5      0   100%
/home/jpic/src/dal/src/dal/__init__.py                                 0      0   100%
/home/jpic/src/dal/src/dal/autocomplete.py                            29      3    90%
/home/jpic/src/dal/src/dal/forms.py                                   51     10    80%
/home/jpic/src/dal/src/dal/forward.py                                 46      9    80%
/home/jpic/src/dal/src/dal/test/__init__.py                            0      0   100%
/home/jpic/src/dal/src/dal/test/case.py                               53      5    91%
/home/jpic/src/dal/src/dal/test/stories.py                           198     12    94%
/home/jpic/src/dal/src/dal/test/utils.py                              33      1    97%
/home/jpic/src/dal/src/dal/views.py                                   97     21    78%
/home/jpic/src/dal/src/dal/widgets.py                                 83     21    75%
/home/jpic/src/dal/src/dal_contenttypes/__init__.py                    0      0   100%
/home/jpic/src/dal/src/dal_contenttypes/fields.py                     19      3    84%
/home/jpic/src/dal/src/dal_queryset_sequence/__init__.py               0      0   100%
/home/jpic/src/dal/src/dal_queryset_sequence/fields.py                81     28    65%
/home/jpic/src/dal/src/dal_queryset_sequence/views.py                 33      5    85%
/home/jpic/src/dal/src/dal_queryset_sequence/widgets.py               23      1    96%
/home/jpic/src/dal/src/dal_select2/__init__.py                         1      0   100%
/home/jpic/src/dal/src/dal_select2/apps.py                             4      0   100%
/home/jpic/src/dal/src/dal_select2/fields.py                          19      0   100%
/home/jpic/src/dal/src/dal_select2/models.py                           0      0   100%
/home/jpic/src/dal/src/dal_select2/test.py                            21      5    76%
/home/jpic/src/dal/src/dal_select2/views.py                          116     14    88%
/home/jpic/src/dal/src/dal_select2/widgets.py                         97     17    82%
/home/jpic/src/dal/src/dal_select2_queryset_sequence/__init__.py       0      0   100%
/home/jpic/src/dal/src/dal_select2_queryset_sequence/fields.py        21      0   100%
/home/jpic/src/dal/src/dal_select2_queryset_sequence/views.py         36      0   100%
/home/jpic/src/dal/src/dal_select2_queryset_sequence/widgets.py        5      0   100%
/home/jpic/src/dal/src/dal_select2_taggit/__init__.py                  0      0   100%
/home/jpic/src/dal/src/dal_select2_taggit/widgets.py                  23      7    70%
custom_select2/__init__.py                                             1      0   100%
custom_select2/admin.py                                               11      0   100%
custom_select2/apps.py                                                 7      0   100%
custom_select2/forms.py                                                8      0   100%
custom_select2/models.py                                               9      1    89%
custom_select2/test_functional.py                                     11      3    73%
custom_select2/widgets.py                                              9      3    67%
forward_different_fields/__init__.py                                   0      0   100%
forward_different_fields/admin.py                                     10      0   100%
forward_different_fields/forms.py                                     19      0   100%
forward_different_fields/models.py                                     7      1    86%
forward_different_fields/urls.py                                      15     10    33%
linked_data/__init__.py                                                1      0   100%
linked_data/admin.py                                                  11      0   100%
linked_data/apps.py                                                    7      0   100%
linked_data/forms.py                                                  16      5    69%
linked_data/models.py                                                 10      1    90%
linked_data/test_functional.py                                        36      0   100%
linked_data/urls.py                                                   11      5    55%
rename_forward/__init__.py                                             1      0   100%
rename_forward/admin.py                                               11      0   100%
rename_forward/apps.py                                                 3      0   100%
rename_forward/forms.py                                               10      0   100%
rename_forward/models.py                                              10      0   100%
rename_forward/test_functional.py                                      5      0   100%
rename_forward/urls.py                                                14      1    93%
secure_data/__init__.py                                                1      0   100%
secure_data/admin.py                                                  17      0   100%
secure_data/apps.py                                                    7      0   100%
secure_data/forms.py                                                   8      0   100%
secure_data/models.py                                                 10      0   100%
secure_data/test_functional.py                                        18      0   100%
secure_data/urls.py                                                    7      0   100%
select2_foreign_key/__init__.py                                        1      0   100%
select2_foreign_key/admin.py                                          11      0   100%
select2_foreign_key/apps.py                                            7      0   100%
select2_foreign_key/forms.py                                           8      0   100%
select2_foreign_key/models.py                                          7      0   100%
select2_foreign_key/test_functional.py                                47      0   100%
select2_foreign_key/urls.py                                            4      0   100%
select2_generic_foreign_key/__init__.py                                1      0   100%
select2_generic_foreign_key/admin.py                                  11      0   100%
select2_generic_foreign_key/apps.py                                    8      0   100%
select2_generic_foreign_key/forms.py                                  11      0   100%
select2_generic_foreign_key/models.py                                 21      1    95%
select2_generic_foreign_key/test_forms.py                             48      2    96%
select2_generic_foreign_key/test_functional.py                        25      0   100%
select2_generic_foreign_key/urls.py                                    6      0   100%
select2_list/__init__.py                                               0      0   100%
select2_list/admin.py                                                 11      0   100%
select2_list/forms.py                                                  9      1    89%
select2_list/models.py                                                 9      0   100%
select2_list/test_fields.py                                           36      0   100%
select2_list/test_functional.py                                       48      0   100%
select2_list/test_views.py                                           137      0   100%
select2_list/urls.py                                                   3      0   100%
select2_list/views.py                                                 12      2    83%
select2_many_to_many/__init__.py                                       1      0   100%
select2_many_to_many/admin.py                                         11      0   100%
select2_many_to_many/apps.py                                           7      0   100%
select2_many_to_many/forms.py                                          8      0   100%
select2_many_to_many/models.py                                         9      0   100%
select2_many_to_many/test_functional.py                               21      0   100%
select2_many_to_many/urls.py                                           6      0   100%
select2_nestedadmin/__init__.py                                        1      0   100%
select2_nestedadmin/admin.py                                          16      0   100%
select2_nestedadmin/apps.py                                            3      0   100%
select2_nestedadmin/forms.py                                           8      0   100%
select2_nestedadmin/models.py                                         22      3    86%
select2_nestedadmin/test_functional.py                                19      0   100%
select2_nestedadmin/urls.py                                           13      1    92%
select2_one_to_one/__init__.py                                         1      0   100%
select2_one_to_one/admin.py                                           11      0   100%
select2_one_to_one/apps.py                                             7      0   100%
select2_one_to_one/forms.py                                            7      0   100%
select2_one_to_one/models.py                                           9      0   100%
select2_one_to_one/test_functional.py                                 20      0   100%
select2_one_to_one/urls.py                                             6      0   100%
select2_outside_admin/__init__.py                                      0      0   100%
select2_outside_admin/urls.py                                          3      0   100%
select2_outside_admin/views.py                                        31     14    55%
select2_taggit/__init__.py                                             0      0   100%
select2_taggit/admin.py                                               11      0   100%
select2_taggit/forms.py                                                8      0   100%
select2_taggit/models.py                                              10      1    90%
select2_taggit/test_forms.py                                          40      2    95%
select2_taggit/test_functional.py                                     30      0   100%
select2_taggit/urls.py                                                 4      0   100%
settings/__init__.py                                                   1      0   100%
settings/base.py                                                      84     18    79%
tests/__init__.py                                                      0      0   100%
tests/admin.py                                                         3      0   100%
tests/models.py                                                       11      0   100%
urls.py                                                               11      1    91%
views.py                                                               9      2    78%
--------------------------------------------------------------------------------------
TOTAL                                                               2358    240    90%

================================ 48 passed, 86 warnings in 223.14s (0:03:43) =================================
________________________________ summary ________________________________
  py39-dj31: commands succeeded
  congratulations :)
jpic commented 3 years ago

Here's the missing lines from coverage report too, with tox -e py39-dj31 -- --cov-report=term-missing:

Name                                                               Stmts   Miss  Cover   Missing
------------------------------------------------------------------------------------------------
/home/jpic/src/dal/conftest.py                                         5      0   100%
/home/jpic/src/dal/src/dal/__init__.py                                 0      0   100%
/home/jpic/src/dal/src/dal/autocomplete.py                            29      3    90%   84, 87, 92
/home/jpic/src/dal/src/dal/forms.py                                   51     10    80%   115-121, 132, 136-141, 146
/home/jpic/src/dal/src/dal/forward.py                                 46      9    80%   10, 135-140, 164-169
/home/jpic/src/dal/src/dal/test/__init__.py                            0      0   100%
/home/jpic/src/dal/src/dal/test/case.py                               53      5    91%   11-12, 54-55, 92
/home/jpic/src/dal/src/dal/test/stories.py                           198     10    95%   129-130, 190-193, 197-198, 268-269
/home/jpic/src/dal/src/dal/test/utils.py                              33      1    97%   17
/home/jpic/src/dal/src/dal/views.py                                   97     21    78%   42, 48-49, 52, 94, 113, 120, 122, 124, 136-141, 152, 164, 169, 178, 181, 186
/home/jpic/src/dal/src/dal/widgets.py                                 83     21    75%   12-13, 85, 112-129, 142-144, 154-155, 161, 164
/home/jpic/src/dal/src/dal_contenttypes/__init__.py                    0      0   100%
/home/jpic/src/dal/src/dal_contenttypes/fields.py                     19      3    84%   40-43
/home/jpic/src/dal/src/dal_queryset_sequence/__init__.py               0      0   100%
/home/jpic/src/dal/src/dal_queryset_sequence/fields.py                81     28    65%   27, 72, 88-92, 98-105, 108-120, 123-136, 160
/home/jpic/src/dal/src/dal_queryset_sequence/views.py                 33      5    85%   34, 47-52
/home/jpic/src/dal/src/dal_queryset_sequence/widgets.py               23      1    96%   24
/home/jpic/src/dal/src/dal_select2/__init__.py                         1      0   100%
/home/jpic/src/dal/src/dal_select2/apps.py                             4      0   100%
/home/jpic/src/dal/src/dal_select2/fields.py                          19      0   100%
/home/jpic/src/dal/src/dal_select2/models.py                           0      0   100%
/home/jpic/src/dal/src/dal_select2/test.py                            21      5    76%   25-28, 32
/home/jpic/src/dal/src/dal_select2/views.py                          116     14    88%   93-107, 148, 157, 203-204
/home/jpic/src/dal/src/dal_select2/widgets.py                         97     17    82%   5-10, 24-25, 43, 47-50, 56-57, 155, 177, 181
/home/jpic/src/dal/src/dal_select2_queryset_sequence/__init__.py       0      0   100%
/home/jpic/src/dal/src/dal_select2_queryset_sequence/fields.py        21      0   100%
/home/jpic/src/dal/src/dal_select2_queryset_sequence/views.py         36      0   100%
/home/jpic/src/dal/src/dal_select2_queryset_sequence/widgets.py        5      0   100%
/home/jpic/src/dal/src/dal_select2_taggit/__init__.py                  0      0   100%
/home/jpic/src/dal/src/dal_select2_taggit/widgets.py                  23      7    70%   41-56
custom_select2/__init__.py                                             1      0   100%
custom_select2/admin.py                                               11      0   100%
custom_select2/apps.py                                                 7      0   100%
custom_select2/forms.py                                                8      0   100%
custom_select2/models.py                                               9      1    89%   27
custom_select2/test_functional.py                                     11      3    73%   16-18
custom_select2/widgets.py                                              9      3    67%   11-13
forward_different_fields/__init__.py                                   0      0   100%
forward_different_fields/admin.py                                     10      0   100%
forward_different_fields/forms.py                                     19      0   100%
forward_different_fields/models.py                                     7      1    86%   11
forward_different_fields/urls.py                                      15     10    33%   8-18
linked_data/__init__.py                                                1      0   100%
linked_data/admin.py                                                  11      0   100%
linked_data/apps.py                                                    7      0   100%
linked_data/forms.py                                                  16      5    69%   10-16
linked_data/models.py                                                 10      1    90%   35
linked_data/test_functional.py                                        36      0   100%
linked_data/urls.py                                                   11      5    55%   10-16
rename_forward/__init__.py                                             1      0   100%
rename_forward/admin.py                                               11      0   100%
rename_forward/apps.py                                                 3      0   100%
rename_forward/forms.py                                               10      0   100%
rename_forward/models.py                                              10      0   100%
rename_forward/test_functional.py                                      5      0   100%
rename_forward/urls.py                                                14      1    93%   16
secure_data/__init__.py                                                1      0   100%
secure_data/admin.py                                                  17      0   100%
secure_data/apps.py                                                    7      0   100%
secure_data/forms.py                                                   8      0   100%
secure_data/models.py                                                 10      0   100%
secure_data/test_functional.py                                        18      0   100%
secure_data/urls.py                                                    7      0   100%
select2_foreign_key/__init__.py                                        1      0   100%
select2_foreign_key/admin.py                                          11      0   100%
select2_foreign_key/apps.py                                            7      0   100%
select2_foreign_key/forms.py                                           8      0   100%
select2_foreign_key/models.py                                          7      0   100%
select2_foreign_key/test_functional.py                                47      0   100%
select2_foreign_key/urls.py                                            4      0   100%
select2_generic_foreign_key/__init__.py                                1      0   100%
select2_generic_foreign_key/admin.py                                  11      0   100%
select2_generic_foreign_key/apps.py                                    8      0   100%
select2_generic_foreign_key/forms.py                                  11      0   100%
select2_generic_foreign_key/models.py                                 21      1    95%   63
select2_generic_foreign_key/test_forms.py                             48      2    96%   8-9
select2_generic_foreign_key/test_functional.py                        25      0   100%
select2_generic_foreign_key/urls.py                                    6      0   100%
select2_list/__init__.py                                               0      0   100%
select2_list/admin.py                                                 11      0   100%
select2_list/forms.py                                                  9      1    89%   13
select2_list/models.py                                                 9      0   100%
select2_list/test_fields.py                                           36      0   100%
select2_list/test_functional.py                                       48      0   100%
select2_list/test_views.py                                           137      0   100%
select2_list/urls.py                                                   3      0   100%
select2_list/views.py                                                 12      2    83%   16, 19
select2_many_to_many/__init__.py                                       1      0   100%
select2_many_to_many/admin.py                                         11      0   100%
select2_many_to_many/apps.py                                           7      0   100%
select2_many_to_many/forms.py                                          8      0   100%
select2_many_to_many/models.py                                         9      0   100%
select2_many_to_many/test_functional.py                               21      0   100%
select2_many_to_many/urls.py                                           6      0   100%
select2_nestedadmin/__init__.py                                        1      0   100%
select2_nestedadmin/admin.py                                          16      0   100%
select2_nestedadmin/apps.py                                            3      0   100%
select2_nestedadmin/forms.py                                           8      0   100%
select2_nestedadmin/models.py                                         22      3    86%   12, 29, 53
select2_nestedadmin/test_functional.py                                19      0   100%
select2_nestedadmin/urls.py                                           13      1    92%   20
select2_one_to_one/__init__.py                                         1      0   100%
select2_one_to_one/admin.py                                           11      0   100%
select2_one_to_one/apps.py                                             7      0   100%
select2_one_to_one/forms.py                                            7      0   100%
select2_one_to_one/models.py                                           9      0   100%
select2_one_to_one/test_functional.py                                 20      0   100%
select2_one_to_one/urls.py                                             6      0   100%
select2_outside_admin/__init__.py                                      0      0   100%
select2_outside_admin/urls.py                                          3      0   100%
select2_outside_admin/views.py                                        31     14    55%   3-4, 27, 30-36, 39-41, 45-50
select2_taggit/__init__.py                                             0      0   100%
select2_taggit/admin.py                                               11      0   100%
select2_taggit/forms.py                                                8      0   100%
select2_taggit/models.py                                              10      1    90%   23
select2_taggit/test_forms.py                                          40      2    95%   7-8
select2_taggit/test_functional.py                                     30      0   100%
select2_taggit/urls.py                                                 4      0   100%
settings/__init__.py                                                   1      0   100%
settings/base.py                                                      84     18    79%   12-15, 24, 28, 33-38, 99, 123, 148-149, 159, 182
tests/__init__.py                                                      0      0   100%
tests/admin.py                                                         3      0   100%
tests/models.py                                                       11      0   100%
urls.py                                                               11      1    91%   37
views.py                                                               9      2    78%   3-4
------------------------------------------------------------------------------------------------
TOTAL                                                               2358    238    90%
arseniy-panfilov commented 3 years ago

Hi!

Finally had time to try it out, here are the results:

  1. At first, roughly half of the tests were with what seems to be a selenium complaint: selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
  2. I'm using Chrome, so I figured I'd try export BROWSER=chrome with the corresponding driver downloaded from here;
  3. Now selenium tests fail with another error: selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
  4. Decided to give it a try with Firefox: installed it along with the geckodriver;
  5. All the tests passed!

So I guess Firefox is really required to run the tests now.