0

Is there any way I can use my default local database for testing in Django 1.9. I also don't want to run any migrations, and I want to test it locally.

The reason I want to do it this way is that in my migrations, I have a data migration referring to some entry from a model and when tests run and create a test_database the migrations fail as there are no entries in the test model and this data migration use .get()

I don't know how I should resolve this issue. The best way I could think of is my default database for testing.

Shahrukh Mohammad
  • 985
  • 2
  • 17
  • 33
  • try this django-package, [django-test-without-migrations](https://pypi.org/project/django-test-without-migrations/) – JPG Aug 01 '18 at 06:24
  • I would recommend against using your default database because it's not an isolated environment. A better route would be to create a bunch of objects to populate your test database. The `setUp` method of a `TestCase` class is a good place to do that. – Henry Woody Aug 01 '18 at 10:11

0 Answers0