2

I have a Django app with tests inside its tests folder. The tests have their own models.py too. How can I make migrations for the test model? Everything was working till I made migrations for the app itself. I think it expects to find migrations for the test model now.

App structure:

|______init__.py
|____migrations
| |____0001_initial.py
| |______init__.py
|____models.py
|____settings.py
|____tests
| |______init__.py
| |____models.py <---
| |____tests.py

Error:

django.db.utils.ProgrammingError: (1146, "Table 'test_db.mytestmodel' doesn't exist")

When running:

./manage.py test myapp
Seperman
  • 4,254
  • 1
  • 28
  • 27
  • Why have code for tests outside tests.py? What's in models.py that your tests need to run correctly? – Patrick Beeson Dec 23 '14 at 03:11
  • It is actually not my code. It is Django-tagging package that I'm trying to port to Django 1.7: https://github.com/seperman/django-tagging – Seperman Dec 23 '14 at 18:54
  • possible duplicate of [Models inside tests - Django 1.7 issue](http://stackoverflow.com/questions/25669290/models-inside-tests-django-1-7-issue) – Meistro Jan 06 '15 at 21:26

0 Answers0