I have a functional Django project with a functional database. When I try to run tests on this project, I get this error during database creation:
django.db.utils.InternalError: (1553, "Cannot drop index 'One response per question per level': needed in a foreign key constraint")
I had a unique_together constraint in one of the tables which I later removed.
This line
'One response per question per level'
is related to that unique_together constraint and is present in two migration files - first time during the creation of the table and second time during the removal.
When I run the tests, it is throwing this error and the database is not getting created. How can I solve this problem?