Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix Deprecation Warnings in tests for the next release #1671

@m4ra

Description

@m4ra

A list of items that need to be fixed from the warnings we get when we run the tests from the root directory:

py.test tests --reuse-db
  • Replace active_phase

active_phase is deprecated, use active_phase_ends_next or active_module_ends_next in the following test:
adhocracy4/adhocracy4/projects/models.py:574

  • Replace is_prj_group_member

using is_prj_group_member with an item is deprecated; use is_context_group_member from module predicates instead.
adhocracy4/adhocracy4/projects/predicates.py:10

  • Replace storage class

tests/projects/test_project_models.py::test_delete_project

.pyenv/versions/3.10.0/envs/a4/lib/python3.10/site-packages/easy_thumbnails/storage.py:27: RemovedInDjango51Warning: django.core.files.storage.get_storage_class is deprecated in favor of using django.core.files.storage.storages.

  • Update TopicFactory

.pyenv/versions/3.10.0/envs/a4/lib/python3.10/site-packages/factory/django.py:181: DeprecationWarning: TopicFactory._after_postgeneration will stop saving the instance after postgeneration hooks in the next major release.
If the save call is extraneous, set skip_postgeneration_save=True in the TopicFactory.Meta.
To keep saving the instance, move the save call to your postgeneration hooks or override _after_postgeneration.

  • Update ProjectFactory

.pyenv/versions/3.10.0/envs/a4/lib/python3.10/site-packages/factory/django.py:181: DeprecationWarning: ProjectFactory._after_postgeneration will stop saving the instance after postgeneration hooks in the next major release.
If the save call is extraneous, set skip_postgeneration_save=True in the ProjectFactory.Meta.
To keep saving the instance, move the save call to your postgeneration hooks or override _after_postgeneration.

  • Update UserFactory

.pyenv/versions/3.10.0/envs/a4/lib/python3.10/site-packages/factory/django.py:181: DeprecationWarning: UserFactory._after_postgeneration will stop saving the instance after postgeneration hooks in the next major release.
If the save call is extraneous, set skip_postgeneration_save=True in the UserFactory.Meta.
To keep saving the instance, move the save call to your postgeneration hooks or override _after_postgeneration.

  • Update OrganisationFactory

.pyenv/versions/3.10.0/envs/a4/lib/python3.10/site-packages/factory/django.py:181: DeprecationWarning: OrganisationFactory._after_postgeneration will stop saving the instance after postgeneration hooks in the next major release.
If the save call is extraneous, set skip_postgeneration_save=True in the OrganisationFactory.Meta.
To keep saving the instance, move the save call to your postgeneration hooks or override _after_postgeneration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dev: Backendissue related to backendPrio: Mediumfixed and released with next scheduled release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions