4

We are doing a project which uses more than 10 tables for data flow, but when using unit test for database table data query scheme, it returns an empty set. Is there any way we can run './manage.py test' and it can fetch data from our own database instead of newly created test database?

Here is a similar question, but it does not give any solutions. Django Test Database looks empty while test is runnin

and here Problems with contenttypes when loading a fixture in Django

Thanks!

Community
  • 1
  • 1
Marissa
  • 43
  • 4
  • Do you only want to use existing database? or you just want to fetch data from it and use test database for everything else? – mariodev Nov 12 '13 at 11:45
  • I am trying to follow the steps [here](http://www.jeffknupp.com/blog/2012/02/11/unit-testing-in-django/). Then a problem pops up: 'IntegrityError: Problem installing fixture 'initial_data.json': Could not load contenttypes.ContentType(pk=4): (1062, "Duplicate entry 'contenttypes-contenttype' for key 'app_label'")'. – Marissa Nov 12 '13 at 13:07
  • @mariodev I want to use existing database with real data and do some calculation. Then compare my calculation results with preexisting results to see where my algorithm is correct. Thank you for asking! – Marissa Nov 12 '13 at 13:11

0 Answers0