Edit: My apologies if this was posted in the wrong board. This is either about migrations/db backends or it’s about using Django, but after I posted I realized it might lean more towards the latter.
Issue: My models have managed = False in the meta, which means when I run tests, no new tables can be created. I thought I solved it by doing the below:
- Make a test_migrations folder within my module folder.
- Put my migrations file in there with managed = False commented out
- Putting the below into my settings.py
if 'test' in sys.argv:
MIGRATION_MODULES = {
'webapi': 'webapi.test_migrations',
}
I guess what’s happening is that when I run tests, the tests cannot execute “makemigrations” so this strategy is failing. I’m pretty sure?? My _meta.managed is still False when I do this.
I also tried changing _meta.managed = True right in the tests, but I’m not sure when Django uses this property to check if it is allowed to make tables or not, so ultimately I think it failed.
Any hints?