postgresql - Why django test --keep-db works with postgres database but not with default sqlite3 -


i'm testing django (v1.11.4) application in 2 setups of database: 1) postgres database running in docker container or 2) sqlite3 (default database)

when running tests --keepdb option observe different behavior these 2 setups: postgres --keepdb works expected (there no database creation , running test fast) sqlite3 database --keepdb seems not working (for each run of test there creation of database). possible have --keepdb working sqlite3? if idea settings might affect behavior described above?

by default, django uses in-memory database when testing sqlite. means test database isn't persistent. can override behaviour in databases setting specifying test name:

databases = {     'default': {         'engine': 'django.db.backends.sqlite',         'name': 'db.sqlite3',         'test': {             'name': 'testdb.sqlite3',         },     }, } 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -