Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: How to keep the test database when the test is finished?

Some of my requirements are these:

  • Create a in-memory sqlite3 database.
  • Read a list, and pull those data from production database.
  • Perform unit tests
  • Remain the test database.
  • Perform some intelligent UI tests using the same test database.

I am not a pro in test, but these have to achieved, anyone professional who can suggest a best practice in this area?

Thanks very much for your help!

like image 916
user469652 Avatar asked Jun 28 '11 01:06

user469652


1 Answers

New in Django 1.8

The --keepdb option can be used to preserve the test database between test runs

https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-option---keepdb

like image 136
Koed00 Avatar answered Oct 29 '22 17:10

Koed00