[Patchew-devel] [PATCH 6/6] server: Use postgres in Docker deploy

Fam Zheng famz at redhat.com
Thu Nov 1 06:34:07 UTC 2018


On Wed, 10/31 14:32, Paolo Bonzini wrote:
> On 31/10/2018 02:28, Fam Zheng wrote:
> > -    elif os.environ.get("PATCHEW_TEST"):
> > -        # Test environment
> > -        return True, os.environ.get("PATCHEW_TEST_DATA_DIR")
> > +        data_dir = os.path.join(os.environ.get("VIRTUAL_ENV",
> > +                                               "/var/tmp/patchew-dev"),
> > +                                "data")
> > +        return (True, data_dir,
> > +            {
> > +                'default': {
> > +                    'ENGINE': 'django.db.backends.sqlite3',
> > +                    'NAME': os.path.join(data_dir, "patchew-db.sqlite3"),
> > +                    }
> 
> Why drop the PATCHEW_TEST case?

Because it's unreachable when venv is used, and it seems the idea is reversed in
the first place and is therefore wrong. The env var is set by
tests/patchewtest.py, but this piece of code can run before that, by
./manage.py.

Fam




More information about the Patchew-devel mailing list