Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove deprecated test config starting from Django 5.0 #733

Merged
merged 1 commit into from
May 16, 2024

Conversation

wookkl
Copy link
Contributor

@wookkl wookkl commented May 16, 2024

Hello,

I found and resolved the issue with testing not functioning in Django 5.0 version, after seeing the issue comment.

The cause was the "TEST": {"SERIALIZE": False} option inside the _get_database_config in tests/settings.py.
This option was deprecated since version 4.0 and removed in version 5.0.

Removing "TEST": {"SERIALIZE": False} leads to an error related to GroupTranslationOptions in tests/translation.py.

self = <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at 0x7f9c9513b880>
query = 'SELECT "auth_group"."id", "auth_group"."name", "auth_group"."name_de", "auth_group"."name_en" FROM "auth_group" ORDER BY "auth_group"."id" ASC', params = ()

    def execute(self, query, params=None):
        if params is None:
            return super().execute(query)
        # Extract names if params is a mapping, i.e. "pyformat" style is used.
        param_names = list(params) if isinstance(params, Mapping) else None
        query = self.convert_query(query, param_names=param_names)
>       return super().execute(query, params)
E       django.db.utils.OperationalError: no such column: auth_group.name_de

To resolve this, I added the TEST_NONSERIALIZED_APPS option.

@last-partizan
Copy link
Collaborator

That's a good start. Can you please add Django 5 to the test matrix next?

@last-partizan last-partizan merged commit b016af5 into deschler:master May 16, 2024
12 of 13 checks passed
@wookkl
Copy link
Contributor Author

wookkl commented May 17, 2024

Will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants