Re: DEFAULT_FILE_STORAGE and tests

2018-09-26 Thread Alessandro Dentella
Ciao Luca! On Tue, Sep 25, 2018 at 12:29:45PM -0700, Luca Bocchi wrote: >Already tried with: >class GeneraliDiscoverRunner(DiscoverRunner): >def setup_test_environment(self, **kwargs): >settings.DEFAULT_FILE_STORAGE = 'web.storage.TestStorage' >

Re: DEFAULT_FILE_STORAGE and tests

2018-09-25 Thread luca bocchi
Il giorno giovedì 20 settembre 2018 15:25:23 UTC+2, sandro dentella ha scritto: > > Hi, > > I have a storage that create some thumbnail and is declared in some > models' fields. It's created inheriting from DEFAULT_FILE_STORAGE and it > just works fine both in FileSystemStorage and in Aws.

Re: DEFAULT_FILE_STORAGE and tests

2018-09-25 Thread luca bocchi
already tried: class GeneraliDiscoverRunner(DiscoverRunner): def setup_test_environment(self, **kwargs): settings.DEFAULT_FILE_STORAGE = 'web.storage.TestStorage' super().setup_test_environment(**kwargs) ? although I'm not sure that settings can be changed at runtime by

Re: DEFAULT_FILE_STORAGE and tests

2018-09-25 Thread luca bocchi
Already tried with: class GeneraliDiscoverRunner(DiscoverRunner): def setup_test_environment(self, **kwargs): settings.DEFAULT_FILE_STORAGE = 'web.storage.TestStorage' super().setup_test_environment(**kwargs) ? otherwise, I'd say to run the test with a custom settings module

Re: DEFAULT_FILE_STORAGE and tests

2018-09-20 Thread Alessandro Dentella
Hi Raffaele, On Thu, Sep 20, 2018 at 03:36:11PM +0200, Raffaele Salmaso wrote: >On Thu, Sep 20, 2018 at 3:25 PM sandro dentella ><[1]sandro.dente...@gmail.com> wrote: > >from django.conf import settings >from django.test.runner import DiscoverRunner >class

Re: DEFAULT_FILE_STORAGE and tests

2018-09-20 Thread Raffaele Salmaso
On Thu, Sep 20, 2018 at 3:25 PM sandro dentella wrote: > > > from django.conf import settings > from django.test.runner import DiscoverRunner > > > class GeneraliDiscoverRunner(DiscoverRunner): > def __init__(self, *args, **kwargs): > settings.DEFAULT_FILE_STORAGE =

DEFAULT_FILE_STORAGE and tests

2018-09-20 Thread sandro dentella
Hi, I have a storage that create some thumbnail and is declared in some models' fields. It's created inheriting from DEFAULT_FILE_STORAGE and it just works fine both in FileSystemStorage and in Aws. For this project need the aws Storage (from Django_storages) but when testing I prefer the