browniebroke / django-codemod

A tool to automatically fix Django deprecations.

Home Page:https://django-codemod.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iterable ConnectionHandler

jayvdb opened this issue · comments

Occurs in the test suite of https://github.com/pmac/django-redirect-urls/ , but I have seen it frequently in test suites which havent been updated to use pytest.

cls = <class 'tests.test_middleware.TestRedirectsMiddleware'>

    @classmethod
    def _validate_databases(cls):
        if cls.databases == '__all__':
            return frozenset(connections)
        for alias in cls.databases:
>           if alias not in connections:
E           TypeError: argument of type 'ConnectionHandler' is not iterable

Hey, I'm not sure I understand what you mean. Is it a bug that you're reporting or are you suggesting a new feature? Can you please elaborate on what does this have to do with django-codemod?

That is a code excerpt for which I need a fixer, and will very likely build it soon.