Hello,
From :
https://stackoverflow.com/questions/56875632/upgrade-django-synchro-for-django-2-2-operationalerror-no-such-table-django
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
<https://github.com/mlier/django-synchro>
(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
<https://docs.djangoproject.com/en/2.2/releases/2.2/#backwards-incompatible-2-2>
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.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/2500d7aa-72ac-e9dc-acbf-24180c570748%40free.fr.
For more options, visit https://groups.google.com/d/optout.