I have an old project that I'm resurrecting that was built with Python 2. I'm getting it going with a more current version of Python and Django (v3.9 and v4.1.2 respectively). I have the app basically up and running and I just tried to get the automated testing going. But I'm getting this error:
django.db.utils.OperationalError: (1074, "Column length too big for column 'body' (max = 16383); use BLOB or TEXT instead")
Unfortunately, I have the 'body' column in multiple objects in my models.py, AND each of them is defined as a TextField (e.g. body = models.TextField()
).
I'm not sure how to post the offending code since the error doesn't specify the exact object. My test is simple as I'm just trying to get testing going:
from django.test import TestCase
class Test_Countries(TestCase):
def setUp(self):
pass
def test_basicCompare(self):
self.assertEqual(1, 1)
Before running the test (python manage.py test IFSServices/tests
), I've ensured that makemigrations and migrate have succeeded.
Any help that anybody could provide to help (incl how to ask a more useful question) would be greatly appreciated.
UPDATE I stumbled across this: https://stackoverflow.com/a/37150997/1524875 If I implement the code to disable migrations per that post, the problem I reported here goes away and the tests behave as expected.