I am trying to upgrade django-synchro to django 2.2. I have already upgraded the project to django 2.1 but I have now a problem with ContentType object
The upgraded version to django 2.1 can be found here
(python runtests.py works, all tests pass)
With django 2.2.3 I have the error
django.db.utils.OperationalError: no such table: django_content_type
It seems that at initialisation, migrations are done on default database and the rest it is done on test database (in memory). So ContentType are not seen in the rest of the code. An error occur when models.py
is read
(content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE))
Any ideas would be very appreciated...
I have looked in Django 2.2 release notes
There are two backwards incompatible changes in 2.2 that can maybe do the error :
TransactionTestCase serialized data loading : Initial data migrations are now loaded in TransactionTestCase at the end of the test, after the database flush. In older versions, this data was loaded at the beginning of the test, but this prevents the test --keepdb option from working properly (the database was empty at the end of the whole test suite). This change shouldn’t have an impact on your tests unless you’ve customized TransactionTestCase’s internals.
Test : Deferrable database constraints are now checked at the end of each TestCase test on SQLite 3.20+, just like on other backends that support deferrable constraints. These checks aren’t implemented for older versions of SQLite because they would require expensive table introspection there.