Git Product home page Git Product logo

Comments (4)

vinnyrose avatar vinnyrose commented on August 16, 2024 1

I think this is likely just an issue with your test setup. I don't think you can avoid a separate settings file, after all a settings file is a great place to have all your settings.

For example, how testing is done in this repo, the tests are all in a separate folder from the source of the package, so a separate settings file is used: https://github.com/un1t/django-cleanup/tree/master/test

You will notice though that there is one test where we do change a setting on the fly:

settings.DEFAULT_FILE_STORAGE = 'test.storage.DeleteErrorStorage'

Going to close as not an issue with django-cleanup.

from django-cleanup.

vinnyrose avatar vinnyrose commented on August 16, 2024

Django-cleanup is setup on django app setup. So if you want to change settings you would have to do it before django is setup. You didn't specify if you use pytest-django or how you setup django but you may want to explore the options that modify or provide the settings before django is setup such as through a tests specific settings file or a pytest plugin: https://pytest-django.readthedocs.io/en/latest/configuring_django.html

from django-cleanup.

OttoAndrey avatar OttoAndrey commented on August 16, 2024

Sorry for late answer. Yes, I'm using pytest-django. And yes, I already use special file for testing testing_settings.py with one row DEFAULT_FILE_STORAGE = "django.core.files.storage.FileSystemStorage" and it works for tests.

But I hoped that here is way setup settings without special separate file :(
For example use only def pytest_configure(): - all settings for pytest in one place.

from django-cleanup.

github-actions avatar github-actions commented on August 16, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from django-cleanup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.