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

Test Django 4.1 #1306

Closed adamchainz closed 2 years ago

adamchainz commented 2 years ago

This PR updates the tox and travis config files to drop old versions of Django and Python, and test Django 4.1.

I tried running the tests locally. The unit tests pass, but those using splinter fail. It seems pytest-splinter is incompatible with some changes to splinter. I tried rolling back splinter as far as version 0.14, but that only got me different errors. The errors with the latest splinter are all:

    @pytest.fixture(scope="session")
    def browser_patches():
        """Browser monkey patches."""
        patch_webdriver()
>       patch_webdriverelement()

../.tox/py310-dj41/lib/python3.10/site-packages/pytest_splinter/plugin.py:278:
_ _ _ 
    def patch_webdriverelement():  # pragma: no cover
        """Patch the WebDriverElement to allow firefox to use mouse_over."""

        def mouse_over(self):
            """Perform a mouse over the element which works."""
            (
                ActionChains(self.parent.driver)
                .move_to_element_with_offset(self._element, 2, 2)
                .perform()
            )

        # Apply the monkey patch for Firefox WebDriverElement
>       firefox.WebDriverElement.mouse_over = mouse_over
E       AttributeError: module 'splinter.driver.webdriver.firefox' has no attribute 'WebDriverElement'

I don't think Travis is still running - it hasn't reported any status on this PR. It may need just re-setting up, to use the GitHub app rather than the old token integration. It would be good to move to GitHub Actions anyway, since that's better maintained.

jpic commented 2 years ago

Apparently so yes, workaround: https://github.com/pytest-dev/pytest-splinter/issues/169#issuecomment-1242379232 Python 3.10 also changed some stuff in collections

jpic commented 2 years ago

I believe py310 and dj4 are supported by https://pypi.org/project/django-autocomplete-light/3.9.5rc0/

Can someone please confirm this?

Also, thanks to @mpasternak for making a new pytest-splinter release! Definitely the most awesome browser API in Python :1st_place_medal:

Thanks!

adamchainz commented 2 years ago

Thank you @jpic . When I'm back working with my client who uses django-autocomplete-light, in a week, I'll test this (unless I get distracted by Djangocon Europe).