Closed kiddhustle closed 6 years ago
Please give me more information to troubleshoot your issue:
cities_country
table actually exist in your test database?django-cities
work outside of Docker?django_migrations
table in your test database?Hi there, so I've just had a look at the test database:
cities_country
does not exist in my test database
The only tables I can see in the test database are:
List of relations
Schema | Name | Type | Owner
--------+-------------------+-------+-----------
public | django_migrations | table | <OWNER>
public | spatial_ref_sys | table | <OWNER>
django-cities
outside of docker and I get the same outcomedjango_migrations
If there are no rows in django_migrations
, then the Django migrations did not run. Something is interrupting your tests such that the migrations aren't working. Double check the migration files in your project, or try commenting out apps one by one until migrations work, then adding apps back in one by one to figure out which app is messing up migrations.
As far as I can tell, this isn't an issue with django-cities, this is an issue with your migrations.
So after seeing that migrations were actually being run I started thinking the same and that this was not a problem with django-cities
. After deactivating (and re-activating one by one) my installed apps in settings.py
I realised that I had an installed app with no migrations. When this was de-activated tests ran as expected.
I think the app migrations came into being in this state after I was squashing migration. Because I am not currently using this app I never go round to migrating it.
I have now removed this app from INSTALLED_APPS and everything works as expected.
Thanks for helping me spot my error and sorry for the confusion!
Good to hear you got things working, I'm glad we got to the bottom of your issue! :smile:
Checklist
master
branch of django-cities.Steps to reproduce
Version
Django==1.11.7 django-cities==0.5.0.5 Python 3.5
pip install
) Please note that the database is being run in a Docker container.Docker build run command
Expected behavior
Tests to run
Actual behavior
An error occurs similar to the one found in #129, but migrations run fine.