On Fri, Oct 22, 2010 at 12:37 PM, Phlip <phlip2...@gmail.com> wrote: > I just tried it: > > DATABASES = { > 'default': { > 'ENGINE': 'django.db.backends.sqlite3', > # TODO restore 'NAME': ':memory:', > 'NAME': '/home/phlip/fun.db', > 'USER': '', > 'PASSWORD': '', > 'HOST': '', > 'PORT': '', > } > } > > Yes that's in my test_settings, yes I'm using "python manage.py test -- > settings=test_settings", and no I can't find that in the home folder. > > If I create models in a setUp(), and if the tests use transactions > around each case, doesn't that mean the transaction would roll the > objects back to nothing, providing test isolation, but at least the > file itself would stick around? Or is :memory: somehow defaulted in, > there?
As I said in my last email, the relevant setting is TEST_NAME. NAME is your normal database name. TEST_NAME is the name of the database during testing. Yes, it defaults to ':memory:' for SQLite. And yes, the test database will be rolled back (if you're using a django.test.TestCase. However, if you're not using a django.test.TestCase, or you break out of the test (e.g.,using sys.exit()), the database will exist on disk. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.