-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when applying migrations but works in django test suite #1100
Comments
I have exactly the same issue, after adding new migration, somehow pytest doesn't run it. |
I am experiencing the same issue and it appears that there are no answers for it. |
Seems like this could be a duplicate of #1045? If so, the unifying issue seems to be having a |
I also faced this issue. I recommend to use django-admin command instead of migration. It's not also the exact solution, but we can avoid the error. |
Background
I have an issue when i using pytest. Originally was using
pytest-django
for running my test suite but after it broke i switched to django test suite. I really like pytest and want to make it work.Issue
The error seem to originate from running the migrations since if i delete all my migrations, remake them, and run pytest it works, but sadly that is not a possibility in my production environment. It also works when running
manage.py test
so the issue should not be with the migration it self.Context
As seen in the error:
Column sop_soptask.media_file does not exist
and stacktrack:Perhaps you meant to reference the column "sop_soptask.media_file_id"
.What this migration (series of migrations) did was extract my sop_soptask.mediafile (Django File field) into a general file model which can be rereferenced and reused (stores poster, blurhash, thumbnail et.c.). so the field has the same name.
Error
ERROR sop/tests/test_task_versions.py::SOPTaskVersionTest::test_new_version_of_task_without_content - django.db.utils.ProgrammingError: column sop_soptask.media_file does not exist
Stacktrace
Hopefully this is just something silly i have done but otherwise might be something bigger.
The text was updated successfully, but these errors were encountered: